Solved

Error creating DOM document

Posted on 2001-07-12
9
278 Views
Last Modified: 2008-02-01
Hi

  I am getting a 'type mismatch' error when I am trying to create a XML document. I have set a reference to Microsost XMl, v4.0.

Could someoen please help.

Dylan

Dim usersDoc As DOMDocument
Set usersDoc = CreateObject("Microsoft.XMLDOM")
0
Comment
Question by:dilantha
9 Comments
 
LVL 2

Expert Comment

by:missionImpossible
Comment Utility
Try

Dim usersDoc As DOMDocument
Set usersDoc = CreateObject("Microsoft.XMLDOMDocument")

or

Dim xmldoc
Set xmldoc = CreateObject("Msxml2.DOMDocument")


0
 
LVL 8

Accepted Solution

by:
Dave_Greene earned 50 total points
Comment Utility
Looks like you are working from VB, why are you using late binding?

<<Set usersDoc = CreateObject("Microsoft.XMLDOM")>>

You could just use

Dim usersDoc As DOMDocument
Set usersDoc = New DOMDocument
0
 
LVL 8

Expert Comment

by:Dave_Greene
Comment Utility
You posted this question in two forums.  You should post the question in only one then post the link in the other forum.
0
 
LVL 2

Expert Comment

by:MicOfLZ
Comment Utility
hi dylan

your code should loo like this:

    Dim xmldoc As New DOMDocument
   
    xmldoc.async = False
    xmldoc.loadXML (strXMLResult) 'if you load XML-data as a String
    xmldoc.load (fileXML) 'if you load XML-file

that should work
MicOfLZ
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 2

Expert Comment

by:MicOfLZ
Comment Utility
remark: use just one load method at a time :-)
0
 
LVL 1

Expert Comment

by:Moondancer
Comment Utility
Greetings, dilantha.  You have asked 41 questions within Experts Exchange, but only closed 20 of them.  I will post follow up comments on all your open items to help you navigate to them and complete them.
__________________________________

It's time to clean up this topic area and that means taking care of this question. Your options at this point are:
 
1. Award points to the Expert who provided an answer, or who helped you most. Do this by clicking on the "Accept Comment as Answer" button that lies above and to the right of the appropriate expert's name.
 
2. PAQ the question because the information might be useful to others, but was not useful to you. To use this option, you must state why the question is no longer useful to you, and the experts need to let me know if they feel that you're being unfair.
 
3.  Ask Community Support to help split points between participating experts.  Just comment here with details.
 
4.  Delete the question because it is of no value to you or to anyone else.  To use this option, you must state why the question is no longer useful to you, and the experts need to let me know if they feel that you're being unfair.
 
If you elect for option 2, 3 or 4, just post comment with details here and I'll take it from there.  We also request that you review any other open questions you might have and update/close them.  Display all your question history from your Member Profile to view details.
 
PLEASE DO NOT AWARD THE POINTS TO ME.
 
____________________________________________
 
 
 
Hi Experts:
 
In the event that the Asker does not respond, I would very much appreciate your opinions as to which Expert ought to receive points (if any) as a result of this question.  Likewise, you can also suggest that I PAQ or delete the question.
 
Experts, please do not add further "answer" information to this question.  I will be back in about one week to finalize this question.
 
Thank you everyone.
 
Moondancer :)
Community Support Moderator @ Experts Exchange
 
P.S.  Engineering has been advised about the error in the comment date/time sort order on some older questions.  REGARDING POINTS and more:  http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp  
0
 
LVL 3

Expert Comment

by:modder
Comment Utility
Hello all,

dilantha is a duplicate account, and it has been closed.

Please advise as to who should get points for this.

modder
Community Support
0
 
LVL 8

Expert Comment

by:Dave_Greene
Comment Utility
My answer should have fixed it for them...
0
 

Author Comment

by:dilantha
Comment Utility
Hi Dave

  Thanx alot. Sorry for the delay.

Dilantha
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

The Problem How to write an Xquery that works like a SQL outer join, providing placeholders for absent data on the outer side?  I give a bit more background at the end. The situation expressed as relational data Let’s work through this.  I’ve …
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
This video discusses moving either the default database or any database to a new volume.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now