VBA:MSXML2.DOMDocument 在宏中更改为 MSXML2.DOMDocument40
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12839024/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
VBA:MSXML2.DOMDocument changed to MSXML2.DOMDocument40 in macro
提问by user1495475
I recently changed "MSXML2.DOMDocument" to "MSXML2.DOMDocument40" because of some reason.It works in my Computer.But the same code doesnt work in another computer. What might be the reason? Please suggest some answer.
由于某种原因,我最近将“MSXML2.DOMDocument”更改为“MSXML2.DOMDocument40”。它在我的计算机上工作。但相同的代码在另一台计算机上不起作用。可能是什么原因?请提出一些答案。
回答by barrowc
MSXML2.DOMDocument
is always a synonym for MSXML2.DOMDocument30
. This corresponds to the library referenced by "Microsoft XML, v3.0" in VBA (msxml3.dll)
MSXML2.DOMDocument
始终是 的同义词MSXML2.DOMDocument30
。这对应于 VBA (msxml3.dll) 中“Microsoft XML, v3.0”引用的库
Microsoft recommend that developers should target the "Microsoft XML, v6.0" library (msxml6.dll) in their applications. This would be done by setting a reference to that library and then using the appropriate types - e.g. MSXML2.DOMDocument60
.
Microsoft 建议开发人员应在其应用程序中以“Microsoft XML, v6.0”库 (msxml6.dll) 为目标。这将通过设置对该库的引用然后使用适当的类型来完成 - 例如MSXML2.DOMDocument60
.
If using the v6.0 library is not possible then developers should fall back on the "Microsoft XML, v3.0" library (msxml3.dll) instead.
如果无法使用 v6.0 库,则开发人员应改用“Microsoft XML, v3.0”库 (msxml3.dll)。
Using any other version of the XML library is not recommended as there is no guarantee that any versions other than v6.0 and v3.0 will be available on a given system. The MSXML2.DOMDocument40
which you used corresponds to the "Microsoft XML, v4.0" library (msxml4.dll) and it is very likely that the computer where this code doesn't run simply doesn't have that library available.
不建议使用任何其他版本的 XML 库,因为不能保证除了 v6.0 和 v3.0 之外的任何版本都可以在给定系统上使用。在MSXML2.DOMDocument40
您使用对应于“微软XML,V4.0”库(msxml4.dll的),它很可能在那里此代码不只是运行的计算机没有该库提供。
For full details see http://blogs.msdn.com/b/xmlteam/archive/2006/10/23/using-the-right-version-of-msxml-in-internet-explorer.aspx
edit:if using late binding, you can find the appropriate ProgIDs here. For DOMDocument60, you would use CreateObject("Msxml2.DOMDocument.6.0")
编辑:如果使用后期绑定,您可以在此处找到适当的 ProgID 。对于 DOMDocument60,您将使用CreateObject("Msxml2.DOMDocument.6.0")