Class XmlMaps (Excel VBA)
The class XmlMaps represents the collection of XmlMap objects that have been added to a workbook. To use a XmlMaps class variable it first needs to be instantiated, for example
Dim xms as XmlMaps
Set xms = ActiveWorkbook.XmlMaps
For Each
Here is an example of processing the XmlMaps items in a collection.
Dim xmlmp As XmlMap
For Each xmlmp In ActiveWorkbook.XmlMaps
Next xmlmp
Add
Adds an XML map to the specified workbook.
Add (Schema, RootElementName)
Dim strSchema As String: strSchema =
Dim xmlmp As XmlMap
Set xmlmp = ActiveWorkbook.XmlMaps.Add(Schema:=strSchema)
Arguments
The following argument is required
Schema (String) - The schema to be added as an XML map. The string can be a path to a schema file, or the schema itself. The path can be specified in the Universal Naming Convention (UNC) or Uniform Resource Locator (URL) format.
Optional arguments
The following argument is optional
RootElementName - The name of the root element. This argument can be ignored if the schema contains only one root element
Count
Returns a Long value that represents the number of objects in the collection.
Dim lngCount As Long
lngCount = ActiveWorkbook.XmlMaps.Count
Item
Returns a single XmlMap object from the collection.
Item (Index)
Index: The name or index number of the object.
Dim xmlmpItem As XmlMap
Set xmlmpItem = ActiveWorkbook.XmlMaps(Index:=1)