Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I initialize an IXMLDOMNode in VBA?

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.

like image 475
kuli Avatar asked Oct 01 '22 11:10

kuli


1 Answers

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:

Dim xmlKnoten As New MSXML2.IXMLDOMNode

Hope that helps.

like image 131
ARich Avatar answered Oct 07 '22 21:10

ARich