Name
workbook.SaveAsXMLData(Filename, Map)
Synopsis
Exports a workbook to an XML datafile through an XML map contained in the workbook.
|
Argument |
Settings |
|---|---|
|
|
The name of the XML datafile to create when the export is complete |
|
|
A reference to an |
Use the XMLMap object’s IsExportable property to test if data can be exported through the map before calling SaveAsXMLData. In some cases, data loaded through an XML map cannot be exported through the same map.
The following code gets a reference to an XML map, checks if the workbook’s data can be exported, then exports the data to a new XML file:
Set xmap = ThisWorkbook.XmlMaps("Order_Map")
If xmap.IsExportable Then
ThisWorkbook.SaveAsXMLData ThisWorkbook.Path & "\data.xml", xmap
Else
MsgBox "XML data could not be exported."
End IfBecome an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access