General information
Category:
COM/DCOM and OLE Automation
Title:
Extracting xml from an excel file
Hello,
Does anyone have exprience with extracting info from an excel ".xml" file?
It should be straight forward. But I'm having problems extracting the xml based on the mappings from an xsd.
I have the following:
ox = CREATEOBJECT('excel.application')
ox.Workbooks.Open("ExcelXMLFile.xml")
oaSheet = ox.ActiveSheet
oxml = oaSheet.XmlMapQuery("ns1:PSV","xmlns:ns1='http://tempuri.org/XMLSchema.xsd'", ox.ActiveWorkbook.XmlMaps("PSV_Map")).Value
The last 3 lines are really on one line. The ".Value" returns the value for the very first node in the xml file. But if I add the first parameter of "/ns1:PSV/ns1:BodyMaterial" for the xpath query, the value will be for the BodyMaterial. I just want to retrieve the whole xml file that excel generates based on the XmlMaps "PSV_Map". Am I making any sense? lol
Thanks,
Daniel
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only