简体   繁体   English

未知的运行时错误:'Workbooks.Add'(800a03ec)

[英]Unknown runtime error: 'Workbooks.Add' (800a03ec)

I have recently inherited a Classic ASP which, among other things, makes use of Excel office automation to dynamically build an Excel file which is then offered as a download to the user. 我最近继承了一个经典ASP,除其他外,它利用Excel办公自动化动态构建一个Excel文件,然后作为下载提供给用户。

The website has recently been moved onto a new Windows Server 2012 R2 server, where it operated without issue until around 2 weeks ago. 该网站最近被转移到一台新的Windows Server 2012 R2服务器上,直到大约2周前它才开始运行。

I have spoken to the infrastructure team, and they reported that a number of Windows Updates were applied (including Office 2010 SP2), around the same time when the website issues were reported. 我已经与基础架构团队进行了交谈,他们报告说,在报告网站问题的同时,已应用了许多Windows更新(包括Office 2010 SP2)。

I have isolated the asp vbscript (see below), which I can use to recreate the error: 我已经隔离了asp vbscript(见下文),我可以用它来重新创建错误:

<%

Dim xlapp, WB
Const xlWorkSheet = -4167 

Set xlapp = Server.CreateObject("Excel.Application")
xlapp.ScreenUpdating = False
Set WB = xlapp.Workbooks.Add(xlWorksheet)

%>

The specific error I receive is: 我收到的具体错误是:

Microsoft VBScript runtime error '800a03ec' Microsoft VBScript运行时错误“800a03ec”

Unknown runtime error: 'Workbooks.Add' 未知的运行时错误:'Workbooks.Add'

/Test.asp, line 8 /Test.asp,第8行

I realise that Office automation is not a recommended approach by Microsoft, but in the mean time, I wondered if the community could assist with this error as I've been reading countless blog posts with potential fixes, none of which have worked. 我意识到Office自动化不是微软推荐的方法,但与此同时,我想知道社区是否可以帮助解决这个错误,因为我已经阅读了无数可能修复的博客文章,但都没有。 For information, I have also had the infrastructure team repair the Office installation as well as reboot the server. 有关信息,我还让基础架构团队修复Office安装以及重新启动服务器。

try changing 尝试改变

Set WB = xlapp.Workbooks.Add(xlWorksheet)

to

Set WB = xlapp.Workbooks.Add()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM