Solved

Error creating DOM document

Posted on 2001-07-12
9
279 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
ID: 6277140
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
ID: 6277511
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
ID: 6277654
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
ID: 6280427
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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 2

Expert Comment

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

Expert Comment

by:Moondancer
ID: 6353359
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
ID: 6489734
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
ID: 6490787
My answer should have fixed it for them...
0
 

Author Comment

by:dilantha
ID: 6497665
Hi Dave

  Thanx alot. Sorry for the delay.

Dilantha
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
DOCTYPE in pubmed 5 58
SQL Remove Elements from XML 6 41
Nessus Scan 1 69
microsoft access - xml 10 58
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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

863 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

19 Experts available now in Live!

Get 1:1 Help Now