Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ActiveX component can't create object: 'MSXML2.DOMDocument'

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

like image 949
Kaja Avatar asked Apr 23 '13 10:04

Kaja


2 Answers

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.

like image 113
Ansgar Wiechers Avatar answered Oct 05 '22 23:10

Ansgar Wiechers


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.

like image 39
Ekkehard.Horner Avatar answered Oct 05 '22 23:10

Ekkehard.Horner