System.Runtime.InteropServices.COMException (0x800A03EC) [英] System.Runtime.InteropServices.COMException (0x800A03EC)

查看:26
本文介绍了System.Runtime.InteropServices.COMException (0x800A03EC)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Microsoft.Office.Interop.Excel.WorkbookClass.SaveAs() 方法在 Windows server 2003 和 XP 上运行良好,但在 Windows server 2008 上运行良好.我复制了它Dll 和权限

Microsoft.Office.Interop.Excel.WorkbookClass.SaveAs() method is working fine on Windows server 2003 and also on XP but not on Windows server 2008. I copied it as it is gave all Dll's and permissions

我也尝试了网上提供的所有解决方案,例如文化设置和DCOM权限.

I have also tried all the solutions given on the net, such as Culture settings and DCOM permission.

出现以下错误:

System.Runtime.InteropServices.COMException (0x800A03EC):异常来自 HRESULT:0x800A03EC

System.Runtime.InteropServices.COMException (0x800A03EC): Exception from HRESULT: 0x800A03EC

Microsoft.Office.Interop.Excel.WorkbookClass.SaveAs(对象文件名,对象文件格式、对象密码、对象 WriteResPassword、对象ReadOnlyRecommended、对象创建备份、XlSaveAsAccessMode访问模式、对象冲突解决、对象 AddToMru、对象TextCodepage, Object TextVisualLayout, Object Local)

Microsoft.Office.Interop.Excel.WorkbookClass.SaveAs(Object Filename, Object FileFormat, Object Password, Object WriteResPassword, Object ReadOnlyRecommended, Object CreateBackup, XlSaveAsAccessMode AccessMode, Object ConflictResolution, Object AddToMru, Object TextCodepage, Object TextVisualLayout, Object Local)

请帮忙..!

推荐答案

找到答案.......!!!!!!

Found Answer.......!!!!!!!

Microsoft 在 Windows Server 2008 上正式不支持 Microsoft Office 2003 Interop.

Officially Microsoft Office 2003 Interop is not supported on Windows server 2008 by Microsoft.

但经过大量的排列和;结合代码和搜索,我们找到了一种适用于我们场景的解决方案.

But after a lot of permutations & combinations with the code and search, we came across one solution which works for our scenario.

解决办法是堵住Windows 2003和2008维护文件夹结构方式的差异,因为Office Interop中间依赖桌面文件夹打开/保存文件.2003 系统在 systemprofile 下包含桌面文件夹,而 2008 则没有.

The solution is to plug the difference between the way Windows 2003 and 2008 maintains its folder structure, because Office Interop depends on the desktop folder for file open/save intermediately. The 2003 system houses the desktop folder under systemprofile which is absent in 2008.

因此,当我们在 2008 年在各自的层次结构下创建此文件夹时,如下所示;Office Interop 可以根据需要保存文件.这个Desktop文件夹需要在

So when we create this folder on 2008 under the respective hierarchy as indicated below; the office Interop is able to save the file as required. This Desktop folder is required to be created under

C:WindowsSystem32configsystemprofile

C:WindowsSystem32configsystemprofile

C:WindowsSysWOW64configsystemprofile

C:WindowsSysWOW64configsystemprofile

这对我有用...

还要检查是否安装了 .NET 1.1,因为 Interop 需要它并且 Windows Server 2008 预装了它

Also do check if .NET 1.1 is installed because its needed by Interop and ot preinstalled by Windows Server 2008

或者你也可以使用 SaveCopyas() 方法只是将参数作为文件名字符串)

Or you can also Use SaveCopyas() method ist just take onargument as filename string)

谢谢你们......!

Thanks Guys..!

这篇关于System.Runtime.InteropServices.COMException (0x800A03EC)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆