Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MSXML reference not working

Status
Not open for further replies.

sourabhjha

Programmer
Jan 13, 2002
121
IN
While using MSXML3.0 reference in my program i am getting runtime error saying "ActiveX component cannot create objects"
My piece of code is:
Dim xmlDoc As MSXML2.DOMDocument30
Set xmlDoc = New MSXML2.DOMDocument30
Here i tried creating the object with all the available option like
MSXML2.DOMDocument30,
MSXML2.DOMDocument26 and
MSXML2.DOMDocument

Any clue as to which other reference i am missing or what else is causing the problem.
And why is that even after using the msxml3.dll in project-reference the object i am creating is of "MSXML2".Should it be MSXML3 or MSXML
PS:earlier i wan using MSXML2.6 in the reference.Then also i was facing the same problem.I upgraded the reference version but that didn't help.Only diff was that the "MSXML2.DOMDocument30" was not available then
Thanks in advance
-Sourabh
 
Your using the wrong declarations.
The intellisense (drop downs) for this declaration are wrong.
Try this:

Dim objXML AS New MSXML2.XMLHTTP30

Give a man a program and tomorrow he will be hungry.
Teach a man to program and he will never hunger again.
--Sunr¿se

 
But i need the DOMdocument here.
Because the next two line of my pgm are like this:

XMLString = &quot;<sample-tag>val</sample-tag>&quot;
Dim blnRes = xmlDoc.loadXML(XMLString)
 
Oh yeah
I use
Dim objXmlDoc as NEW MSXML2.DOMDocument30

I don't instantiate with a SET statement I just use it after this one dim line.

eg

objXmlDoc.Load = &quot;c:\File.xml&quot;

This will parse the xml into a DOMDocument which you can then manipulate.
Give a man a program and tomorrow he will be hungry.
Teach a man to program and he will never hunger again.
--Sunr¿se

 
i was earlier using it the same way as u mentioned.But that also was not working.
In fact i don't understand why with msxml.dll/msxml3.dll my code is not working.It had workd on someone else's system with vb6 installed there.I think i must be mising some registration or othere reference i guess.I tried to register the msxml3.dll but i cud not be done as &quot;initialization failed&quot; message came.I had borrowed the dll from someone thru this forum itself.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top