System.Runtime.InteropServices.COMException (0x800A03EC)

来源:互联网 发布:酷狗音乐关闭网络功能 编辑:程序博客网 时间:2024/05/18 16:58

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.

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.

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\config\systemprofile

AND

C:\Windows\SysWOW64\config\systemprofile

This worked for me...

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

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

Thanks Guys..!

 

解决方法如下:

配置好相关目录的读写权限与组件服务管理工具中Excel的相关权限后,需要建立如下两个目录:

C:\Windows\SysWOW64\config\systemprofile\Desktop 和 C:\Windows\SysWOW64\config\systemprofile\Desktop。

 

原创粉丝点击