Workbook.XmlImportXml (Excel)

Imports an XML data stream that has been previously loaded into memory. Excel uses the first qualifying map found, or if the destination range is specified, Excel automatically lists the data. Possible return values are xlXmlImportElementsTruncated - The contents of the specified XML data file have been truncated because the XML data file is too large for the worksheet, xlXmlImportSuccess - The XML data file was successfully imported, xlXmlImportValidationFailed - The contents of the XML data file do not match the specified schema map.

Don't specify a value for the Destination parameter if you want to import data into an existing mapping. The following conditions cause the XmlImport method to generate run-time errors:

XmlImportXml (Data, ImportMap, Overwrite, Destination)


Dim strData As String: strData = 
Dim xxiXmlImportXml As XlXmlImportResult
xxiXmlImportXml = ActiveWorkbook.XmlImportXml(Data:=strData, ImportMap:=)

Arguments

The following arguments are required:

Data (String) - The data to import.

ImportMap (XmlMap) - The schema map to apply when importing the file.

Optional arguments

The following arguments are optional

Overwrite (Boolean) - If a value is not specified for the Destination parameter, this parameter specifies whether to overwrite data that has been mapped to the schema map specified in the ImportMap parameter. Set to True to overwrite the data or False to append the new data to the existing data. The default value is True. If a value is specified for the Destination parameter, this parameter specifies whether to overwrite existing data. Set to True to overwrite existing data or False to cancel the import if data would be overwritten. The default value is True.

Destination (Range) - Specifies the range where the list will be created. Excel only uses the top-left corner of the range.