Find by value : DOMDocument « XML « VBA / Excel / Access / Word

Find by value

Sub FindNode()
           Dim oXmlDoc As DOMDocument
           Dim oXmlNode As IXMLDOMNode
           Dim oXmlNodes As IXMLDOMNodeList

           Set oXmlDoc = New DOMDocument
           oXmlDoc.async = False
           oXmlDoc.Load (ThisWorkbook.Path & "\EmployeeSales.xml")

           Set oXmlNodes = oXmlDoc.SelectNodes("//Employee[InvoiceAmount>3000]")

           For Each oXmlNode In oXmlNodes
           Debug.Print oXmlNode.Text
End Sub


Related examples in the same category

1.Find by path
2.Find by string value
3.Find and Edit the Node that Contains the FirstName Mike
4.Find and Delete all Nodes for the Employee Bullen