07-21-2015, 03:16 PM
Hi All
I am using the below code to retrieve data from xml file. I need to retrieve xml value for many nodes hence thought of passing the node path for xml from datasheet. But when I execute the code i'm getting "Expected End statement" error.
Please find the code below:
I am getting "Expected End statement" error in line:
Pls help in resolving this
I am using the below code to retrieve data from xml file. I need to retrieve xml value for many nodes hence thought of passing the node path for xml from datasheet. But when I execute the code i'm getting "Expected End statement" error.
Please find the code below:
Code:
Datatable.ImportSheet "filepath", "sheetname", 1
Set xmlDoc = CreateObject("Microsoft.XMLDOM")
xmlDoc.Async = False
XMLDataFile = "xmlFilepath"
xmlDoc.Load (XMLDataFile)
Set nodes = xmlDoc.SelectNodes Datatable.Value ("XML_Node") 'Here I'm passing "/ListOfOrder/Order/Id/text()" value in datasheet
msgbox "total count of id tag is " & nodes.length
For i = 0 To (nodes.Length - 1)
Id = nodes(i).NodeValue
Msgbox "The name of Author is " & Id
Next
I am getting "Expected End statement" error in line:
Code:
Set nodes = xmlDoc.SelectNodes Datatable.Value ("XML_Node")
Pls help in resolving this