抛出HRESULT的Workbooks.Open方法:0x800A03EC [英] Workbooks.Open method throwing HRESULT: 0x800A03EC

查看:130
本文介绍了抛出HRESULT的Workbooks.Open方法:0x800A03EC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用打开Excel文件

 object missing = Type.Missing;

xlWorkBook = xlApp.Workbooks.Open(strFilePath, missing, false, missing, missing, missing,
true, missing, missing, missing, missing, true, missing, missing, missing);

并抛出HRESULT: 0x800A03EC

它在Office 2010上运行正常,但是将Office库更新到版本15并部署到具有Office 2013的服务器后.我开始收到此消息. 我还尝试过授予DomConfig中的Excel Object权限,但这没有用,

解决方案

当前使用什么版本的Office PIA都没有关系,因为即使使用旧的PIA,您的代码也应可与最新的Office版本一起使用.

相反,请看一下服务器注意事项的自动化方面文章指出:

Microsoft当前不建议并且不支持通过任何无人参与的非交互式客户端应用程序或组件(包括ASP,ASP.NET,DCOM和NT Services)使Microsoft Office应用程序自动化.在此环境中运行Office时,可能表现出不稳定的行为和/或死锁.

I am opening an excel file using

 object missing = Type.Missing;

xlWorkBook = xlApp.Workbooks.Open(strFilePath, missing, false, missing, missing, missing,
true, missing, missing, missing, missing, true, missing, missing, missing);

and it throws HRESULT: 0x800A03EC

It was working fine with office 2010 but after updating office libraries to version 15 and when deployed to server which had office 2013. I started getting this message. I have also tried giving permission to Excel Object in DomConfig but it didn't worked,,

解决方案

It doesn't matter what version of Office PIAs you are using at the moment because even with old PIAs your code should work against the newest Office versions.

Instead, take a look a look at the Considerations for server-side Automation of Office article which states the following:

Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.

这篇关于抛出HRESULT的Workbooks.Open方法:0x800A03EC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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