April 2006
Beginner
1114 pages
98h 16m
English
Use the XmlMap object to import or export XML from code. For example, the following line imports an XML file into an existing XML map in a workbook:
ThisWorkbook.XmlMaps("Order_Map").Import (ThisWorkbook.Path & "\1002.ord")Similarly, the XmlMap object’s Export method exports XML data from a workbook. The following code exports data through an existing XML map:
ThisWorkbook.XmlMaps("Order_Map").Export ThisWorkbook.Path & "\1002.ord"Use the ImportXml and ExportXml methods to import or export XML as a string variable rather than as a file. For example, the following code displays the contents of a list mapped using the Order_Map as XML in the Debug window:
Dim xmap As XmlMap, xml As String, res As XlXmlExportResult
Set xmap = ThisWorkbook.XmlMaps("Order_Map")
res = xmap.ExportXml(xml)
Debug.Print xmlRead now
Unlock full access