ActiveX component can't create object: 'MSXML2.DOMDocument'
Asked Answered
C

3

9

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

Catwalk answered 23/4, 2013 at 10:32 Comment(0)
C
18

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.

Combinative answered 23/4, 2013 at 11:27 Comment(0)
B
6

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.

Bizerte answered 23/4, 2013 at 14:34 Comment(0)
E
0

Three things you need to check:

  1. While registering MSXML4 make sure the MSXML4r.dll is at the same path as MSXML4.dll
  2. Register using proper syntax Regsvr32 msxml4.dll
  3. Enable 32 bit in IIS app pool
Emporium answered 8/6, 2023 at 13:14 Comment(1)
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From ReviewVellum

© 2022 - 2024 — McMap. All rights reserved.