Information générale
Catégorie:
COM/DCOM et OLE Automation
Titre:
Extracting xml from an excel file
Versions des environnements
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
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement