04-15-2009, 01:57 PM
You can use XML dom method to read the file.
Sample code:
Sample code:
Code:
Const XMLDataFile = "C:\TestData.xml"
Set xmlDoc = CreateObject("Microsoft.XMLDOM")
xmlDoc.Async = False
xmlDoc.Load(XMLDataFile)
' For setting the node
Set nodes = xmlDoc.SelectNodes("/bookstore/book") ' This is the nodes in the xml file
MsgBox "Total books: " & nodes.Length
Set nodes = xmlDoc.SelectNodes("/bookstore/book/title/text()")
' get their values
For i = 0 To (nodes.Length - 1)
Title = nodes(i).NodeValue
MsgBox "Title #" & (i + 1) & ": " & Title
Next