Syntax

expression.XmlImportXml(Data, ImportMap, Overwrite, Destination)

expression A variable that represents a Workbook object.

Parameters

Name Required/Optional Data Type Description
Data Required String The data to import.
ImportMap Required The schema map to apply when importing the file.
Overwrite Optional Variant If a value is not specified for the Destination parameter, then this parameter specifies whether or not 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, then this parameter specifies whether or not 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 Optional Variant Specifies the range where the list will be created. Excel only uses the top left corner of the range.

Return Value

Remarks

XlXmlImportResult can be one of the following XlXmlImportResult constants.
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 data being imported failed schema validation, but was imported anyway.

Don't specify a value for the Destination parameter if you want to import data into an existing mapping.

The following conditions will cause the method to generate run-time errors:

Use the XMLImport method of the object to import an XML data file into the current workbook.xml xml import xml xml import xml method xmlimport xmlimportxml

See also: