View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mike Archer Mike Archer is offline
external usenet poster
 
Posts: 52
Default Loading xml files

Hello - I have had luck loading xml files using the following declaration and
assignment in the sub routine:

Set xmlDoc = CreateObject("Microsoft.XMLDOM")
xmlDoc.async = "false"
xmlDoc.Load ("G:\CatTree.xml")

However, I have downloaded a sample excel file that makes the following
declaration in the declarations section of the module:

Dim catTree As MSXML2.DOMDocument

And later in the sub routine, the file is loaded with the following code:

Set catTree = New Msxml2.DOMDocument
catTree.async = False
catTree.Load (catTreeFileLocation)

What is the difference between the two ways of handling xml. The reason I
ask is that the 2nd example works just fine in the excel file that I
downloaded. But if I try to duplicate in any other file, I get a compile
error: "User-defined type not defined." at the module level declaration.
What could be the difference between the file I downloaded and a file I
create myself? I'm talking about duplicating the whole project so that there
is no difference... I still get the compile error.
--
Thanks,
Mike