MSXML2.DOMDocument60 crashes Excel

扶醉桌前 提交于 2019-12-12 16:04:12

问题


I have written a VBA macro to load and parse an XML file. This exact code has worked fine for awhile, but now it's no longer functioning. I've tested it on two different computers running Excel 2013 64-bit. The code it fails on is below:

Public Sub RunClashImport()
'This subroutine will import an XML clash report, parse it, and write it to our workbook
Dim iRow As Integer

'Get XML file
Dim xmlFile As MSXML2.DOMDocument60
Set xmlFile = New MSXML2.DOMDocument60

The code continues if I comment out the Set command. It doesn't throw an error, it crashes Excel entirely. The code above is where the macro starts, there is no code running before it. I have set a reference to v6.0 of MSXML


回答1:


For a 64 bit Windows OS you should put your msxml6.dll inside of C:\Windows\SysWOW64 and then register it from that location, by running this command in your command prompt regsvr32.exe C:\Windows\SysWOW64\msxml6.dll.

Make sure that you run you command prompt as Administrator.



来源:https://stackoverflow.com/questions/21717778/msxml2-domdocument60-crashes-excel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!