XmlMap Interface

Definition

Represents an XML map that has been added to a workbook.

public interface class XmlMap
[System.Runtime.InteropServices.Guid("0002447B-0000-0000-C000-000000000046")]
[System.Runtime.InteropServices.InterfaceType(2)]
public interface XmlMap
Public Interface XmlMap
Attributes

Remarks

XML features, except for saving files in the XML Spreadsheet format, are available only in Microsoft Office Professional Edition 2003 and Microsoft Office Excel 2003.

Use the Add(String, Object) method of the XmlMaps collection to add an XML map to a workbook.

Importing and exporting XML data

Use the Import(String, Object) method to import XML data from an XML data file into cells mapped to the specified XmlMap. The ImportXml(String, Object) method imports XML data for a String variable.

Use the Export(String, Object) method to export data from cells mapped to the specified XmlMap. The ExportXml(String) method exports XML data to a String variable.

Properties

_Default
AdjustColumnWidth

True if the column widths are automatically adjusted for the best fit each time you refresh the specified query table or XML map. False if the column widths aren’t automatically adjusted with each refresh. The default value is True. Read/write Boolean.

AppendOnImport

True if you want to append new rows to XML lists that are bound to the specified schema map when you are importing new data or refreshing an existing connection. False if you want to overwrite the contents of cells. The default value is False. Read/write Boolean.

Application

Returns an Application object that represents the Microsoft Excel application. Read-only.

Creator

Returns a 32-bit integer that indicates the application in which this object was created. If the object was created in Microsoft Excel, this property returns the string XCEL, which is equivalent to the hexadecimal number 5843454C. Read-only XlCreator.

DataBinding

Returns an XmlDataBinding object that represents the binding associated with the specified schema map. Read-only.

IsExportable

Returns True if Microsoft Excel can use the XPath objects in the specified schema map to export XML data and if all XML lists mapped to the specified schema map can be exported. Read-only Boolean.

Name

Returns or sets the friendly name used to uniquely identify a mapping in the workbook. Read/write String.

Parent

Returns the parent object for the specified object. Read-only.

PreserveColumnFilter

Returns or sets whether filtering is preserved when the specified XML map is refreshed. Read/write Boolean.

PreserveNumberFormatting

True if number formatting on cells mapped to the specified XML schema map will be preserved when the schema map is refreshed. The default value is False. Read/write Boolean.

RootElementName

Returns a String that represents the name of the root element for the specified XML schema map. Read-only.

RootElementNamespace

Returns an XmlNamespace object that represents the root element for the specified XML schema map. Read-only.

SaveDataSourceDefinition

True if the data source definition of the specified XML schema map is saved with the workbook. The default value is True. Read/write Boolean.

Schemas

Returns an XmlSchemas collection that represents the schemas that the specified XmlMap object contains. Read-only.

ShowImportExportValidationErrors

Returns or sets whether to display a dialog box that details schema-validation errors when data is imported or exported through the specified XML schema map. The default value is False. Read/write Boolean.

WorkbookConnection

Retuns a new connection for the specified XmlMap object. Read-only.

Methods

Delete()

Removes the specified XML map from the workbook.

Export(String, Object)

Exports the contents of cells mapped to the specified XmlMap object to an XML data file. Returns XlXmlExportResult.

ExportXml(String)

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

Import(String, Object)

Imports data from the specified XML data file into cells that have been mapped to the specified XmlMap object. Returns XlXmlImportResult.

ImportXml(String, Object)

Imports XML data from a String variable into cells that have been mapped to the specified XmlMap object. Returns an XlXmlImportResult constant.

Applies to