简体   繁体   English

VBS Excel.Application.Workbooks运行时错误800A0007内存不足

[英]VBS Excel.Application.Workbooks runtime error 800A0007 Out of Memory

All my scripts stop working and returns 800a0007 Out of Memory runtime error. 我所有的脚本都停止工作,并返回800a0007 Out of Memory运行时错误。 Till today everything was fine. 到今天为止一切都很好。 There were no major changes in system (Win 7 64bit), I even uninstalled latest updates. 系统没有重大变化(Win 7 64位),我什至卸载了最新更新。

Basically, scripts are opening Excel instance, then opening workbook and refreshing all ODBC and Pivots. 基本上,脚本是打开Excel实例,然后打开工作簿并刷新所有ODBC和Pivots。 Opening excel and workbook works fine, problem is occurring when script tried to do something with workbook. 打开excel和工作簿工作正常,脚本尝试对工作簿进行操作时出现问题。

I wrote simple code (it's opening empty existing excel file), in this case error occured on line 8: Set oWorkbook = .Workbooks(workbookName). 我写了简单的代码(它打开了空的现有excel文件),在这种情况下,在第8行发生了错误:设置oWorkbook = .Workbooks(workbookName)。

excelFileLocation = "D:\files\"
workbookName = "test.xlsx"
Set oExcApp = CreateObject("Excel.Application")
With oExcApp 
    .Application.DisplayAlerts = False
    .Application.ScreenUpdating = False
    .Workbooks.Open excelFileLocation & workbookName
    Set oWorkbook = .Workbooks(workbookName)
    .Application.Quit
End With

There is enough space on disk, in physical memory, paging file... Error occurs running cmd/cscript from System32 and SysWOW64. 磁盘上,物理内存,页面文件中有足够的空间...从System32和SysWOW64运行cmd / cscript时出错。

Of course I can run manually Excel, open workbook, refresh everything, save file and everything works fine. 当然,我可以手动运行Excel,打开工作簿,刷新所有内容,保存文件,并且一切正常。

Please, help me with this issue.. 请帮我解决这个问题。

I already found solution - weird story... 我已经找到解决方案-奇怪的故事...

I checked Applications logs in Windows Event Viewer. 我在Windows事件查看器中检查了“应用程序日志”。 There was log saying that Skype for business was uninstalled. 有日志说Skype for business已卸载。 Another log says that in this same time and also from MsiInstaller was triggered configuring Office Components and few other MS Office things. 另一则日志显示,与此同时(也是从MsiInstaller中)触发了配置Office组件和其他一些MS Office事情。

So, i disabled WMI service (i already restarted WMI earlier but it changes nothing),installed Skype again to force reconfigure some things, restarted machine and started WMI service. 因此,我禁用了WMI服务(我早些时候已经重新启动了WMI,但是它没有任何改变),再次安装了Skype以强制重新配置某些内容,重新启动了计算机,并启动了WMI服务。 Now everything is ok. 现在一切正常。

It looks that removing Skype For Business was a major change :) Or it was only coincidence... 看起来删除Skype for Business是一个重大更改:)或这仅仅是巧合...

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

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