When I use the this code in an Excel VBA macro:
Dim xmlKnoten As New IXMLDOMNode
I always get an error. How do I initiate it right?
The initiation of an DOMDocument
works:
Dim xmlDoc As Object
Set xmlDoc = CreateObject("Msxml2.DOMDocument")
Thanks for helping.
First, ensure you have the Microsoft XML reference enabled (my version is v3.0). Once you have that enabled, your code should work, but if it doesn't you can write it like this:
Hope that helps.