0

In VBA (with reference to MSXML2.DOMDocument60) I have two nodes:

Dim nodeFoo As MSXML2.IXMLDOMNode
Dim nodeBar As MSXML2.IXMLDOMNode

These nodes are assigned values, for what its worth nodeFoo is assigned via an xPath expression whereas nodeBar is assigned by looping through a set of nodes.

The challenge is to determine if: nodeBar = nodeFoo (i.e. if it is the same actual node).

Searching google suggested it is possible using isSameNode but I'm unable to find an equivalent in MSXML2.

Community
  • 1
  • 1
SlowLearner
  • 3,086
  • 24
  • 54

1 Answers1

1

Typically you'd use Is to determine whether two object variables point to the same object.

E.g. see VBA: how to test for object equality (whether two variables reference the same object)

Example:

For Each nodeFoo In allNodes
If nodeFoo Is nodeBar Then 
    ' do something
SlowLearner
  • 3,086
  • 24
  • 54
Tim Williams
  • 154,628
  • 8
  • 97
  • 125