I am trying to create an instance of the object Msxml2.DOMDocument.4.0, but I am getting the following error: ActiveX component can't create object: 'MSXML2.DOMDocument'
The error occures in this line: Set xmlDoc = CreateObject("Msxml2.DOMDocument.4.0")
How can I solve this problem?
Thank you for your helps
Check if msxml4.dll
exists on your system. and (re-)register the library if it does:
cd %SystemRoot%\system32
regsvr32 /u msxml4.dll
regsvr32 msxml4.dll
You need admin privileges to do this.
Probably the specific version 4.0 of Msxml2.DOMDocument is not (properly) installed on the computer your script runs on. Try to create the version-independent object:
Set xmlDoc = CreateObject("Msxml2.DOMDocument")
This should give you the version that 'works' on your machine. If this fails, try
Set xmlDoc = CreateObject("Msxml2.DOMDocument.6.0")
or experiment with the version number. Use TypeName(xmlDoc)
to get a hint wrt the effective version.
P.S. If your problem is caused by 32 vs. 64 bit troubles, this may give you further hints for things to check.
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