XmlMap.ExportXml method (Excel)

Exports the contents of cells mapped to the specified XmlMap object to a String variable.


expression.ExportXml (Data)

expression A variable that represents an XmlMap object.


Name Required/Optional Data type Description
Data Required String The variable to export the data to.

Return value



To export the contents of the mapped cells to an XML data file, use the Export method.


The following example exports the contents of the cells mapped to the Contacts schema map to a variable named strContactData.

Sub ExportToString() 
 Dim strContactData As String 
 ActiveWorkbook.XmlMaps("Contacts").ExportXml Data:=strContactData 
End Sub

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.