It sounds like the error is caused because you have not created a reference
to the library that defines MSXML2
in the workbook that workds, go into the VBE and with that workbook as the
activeproject in the vbe (selected in the project explorer window), go into
Tools=>References. You should see a reference to Microsoft XML, ver x.x
where x.x will be the version number. Then you can go to the object
browser and select MSXML2 and see the objects such as DOMDocument.
So in your other applications, you will need to set the reference to use the
second approach. The first approach you show is called late binding and
avoids the need to set the reference.

Signature
Regards,
Tom Ogilvy
> Hello - I have had luck loading xml files using the following declaration and
> assignment in the sub routine:
[quoted text clipped - 21 lines]
> create myself? I'm talking about duplicating the whole project so that there
> is no difference... I still get the compile error.
Mike Archer - 20 May 2006 18:04 GMT
Great! That works now. BTW - Are there any disadvantages to using the late
binding approach? I like not having to worry about setting the library
reference.

Signature
Thanks,
Mike
> It sounds like the error is caused because you have not created a reference
> to the library that defines MSXML2
[quoted text clipped - 37 lines]
> there
> > is no difference... I still get the compile error.
Tom Ogilvy - 20 May 2006 18:34 GMT
It is slower and in development, you don't get intellisense. However, it
isn't a lot slower.
A lot of people use early binding for development, then switch to late
binding for distribution to avoid version problems with library references.

Signature
Regards,
Tom Ogilvy
> Great! That works now. BTW - Are there any disadvantages to using the late
> binding approach? I like not having to worry about setting the library
[quoted text clipped - 41 lines]
> > there
> > > is no difference... I still get the compile error.