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
is always a synonym for MSXML2.DOMDocument30
. This corresponds to the library referenced by "Microsoft XML, v3.0" in VBA (msxml3.dll)
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
.
If using the v6.0 library is not possible then developers should fall back on the "Microsoft XML, v3.0" library (msxml3.dll) instead.
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.
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")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With