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

查看:547
本文介绍了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(目标文件名,   对象FILEFORMAT,对象口令,对象WriteResPassword,对象   ReadOnlyRecommended,对象CreateBackup,XlSaveAsAccessMode   AccessMode,对象形冲突,对象AddToMru,对象   文字codePAGE,对象TextVisu​​alLayout,对象本地)

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 Office 2003的互操作不支持微软Windows Server 2008上。

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

但很多排列与放大器之后;组合与code和搜索,我们遇到了一个解决方案而适用于我们的场景。

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互操作依赖于桌面文件夹中的文件打开/保存intermediately。 2003年系统公司在systemprofile,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年此文件夹中的各个层次下,如下图所示;办公室互操作是能根据需要保存文件。须根据

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:\ WINDOWS \ system32 \设置\ systemprofile,systemprofile系统

C:\Windows\System32\config\systemprofile

C:\ WINDOWS \ Syswow64资料\设置\ systemprofile,systemprofile系统

C:\Windows\SysWOW64\config\systemprofile

这工作对我来说...

This worked for me...

另外做检查,如果.NET 1.1的安装,因为它需要的互操作性,并在Windows Server pinstalled OT $ P $ 2008年

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

或者,你也可以使用SaveCopyas()方法IST只是把onargument为文件名字符串)

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

谢谢你们..!

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

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