Class XmlMap (Excel VBA)

The class XmlMap represents an XML map that has been added to a workbook.

The main procedures of class XmlMap are Delete and XmlMaps.Add

Set

To use a XmlMap class variable it first needs to be instantiated, for example

Dim xmlmp as XmlMap
Set xmlmp = ActiveWorkbook.XmlMaps(Index:=1)

The following procedures can be used to set variables of type XmlMap: ListObject.XmlMap, XmlMaps.Item, XmlMaps.Add, XPath.Map and Workbook.XmlMaps

For Each

Here is an example of processing the XmlMap items in a collection.

Dim xmlmp As XmlMap
For Each xmlmp In ActiveWorkbook.XmlMaps
	
Next xmlmp

Themes

Some procedures in this class have been grouped together in themes and are described on separate theme pages

Import/Export with its procedures AppendOnImport, Export, ExportXml, Import, ImportXml, IsExportable and ShowImportExportValidationErrors
Name with its procedures RootElementName and RootElementNamespace

Methods

These are the main methods of the XmlMap class

Delete - Removes the specified XML map from the workbook.

ActiveWorkbook.XmlMaps(1).Delete

XmlMaps.Add - Adds an XML map to the specified workbook.

Dim strSchema As String: strSchema = 
Dim xmlmp As XmlMap
Set xmlmp = ActiveWorkbook.XmlMaps.Add(Schema:=strSchema)

Properties

AdjustColumnWidth true if the column widths are automatically adjusted for the best fit each time that you refresh the specified XML map.

DataBinding returns an XmlDataBinding object that represents the binding associated with the specified schema map.

Name returns or sets a String value that represents the friendly name used to uniquely identify a mapping in the workbook.

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.

PreserveNumberFormatting true if number formatting on cells mapped to the specified XML schema map are preserved when the schema map is refreshed. The default value is False.

SaveDataSourceDefinition true if the data source definition of the specified XML schema map is saved with the workbook. The default value is True.

Schemas returns an XmlSchemas collection that represents the schemas that the specified XmlMap object contains.

WorkbookConnection returns a new connection for the specified XMLMap object.

XmlMaps.Count returns a Long value that represents the number of objects in the collection.

XmlMaps.Item returns a single XmlMap object from the collection.

XmlMaps.Parent returns the parent object for the specified object. Read-only.