Share via


Workbook.XmlImportXml(String, XmlMap, Object, Object) Method

Definition

Imports an XML data stream that has been previously loaded into memory.

public Microsoft.Office.Interop.Excel.XlXmlImportResult XmlImportXml (string Data, out Microsoft.Office.Interop.Excel.XmlMap ImportMap, object Overwrite, object Destination);
abstract member XmlImportXml : string * XmlMap * obj * obj -> Microsoft.Office.Interop.Excel.XlXmlImportResult
Public Function XmlImportXml (Data As String, ByRef ImportMap As XmlMap, Optional Overwrite As Object, Optional Destination As Object) As XlXmlImportResult

Parameters

Data
String

The data to import.

ImportMap
XmlMap

The schema map to apply when importing the file.

Overwrite
Object

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
Object

The data will be imported into a new XML list in the Range specified.

Returns

One of the XlXmlImportResult values.

Remarks

Do not specify a value for the Destination parameter if you want to import data into an existing mapping.

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

  • The specified XML data contains syntax errors.

  • The import process was cancelled because the specified data cannot fit into the worksheet.

Use the XmlImport method to import an XML data file into the current workbook.

Optional Parameters

For information on optional parameters, see Optional Parameters in Office Solutions.

Applies to