MapData Property

Microsoft Office Web Components Visual Basic

MapData Property

You use the MapData property to specify or determine the schema map for an XmlMap object. Read/write String.

expression .MapData

expression    Required. An expression that returns an XmlMap object.

Remarks

The XmlMap object is created when an XML Spreadsheet file containing binding and mapping information is loaded into the Spreadsheet component by setting the XMLURL or XMLData property. You can create an XML Spreadsheet file by importing and mapping data to a worksheet using Microsoft Office Excel 2003, and then saving the workbook as an XML Spreadsheet file. Setting the MapData property will replace any existing schema map with the new schema map you specify.

Example

The following example uses the MapData property of the XmlMap object to return the schema map:

    Dim objMap
Dim strMapData

For Each objMap in Spreadsheet1.ActiveWorkbook.XmlMaps
     ' Save the xml map information to a variable.     
     strMapData = objMap.MapData
     ' Work with map info xml here.
Next


  

The next example is a function that sets the MapData property:

    Function ChangeMapSchema(objMap, strMapData)
On Error Resume Next
objMap.MapData = strMapData

	If Err.Number <> 0 Then
		ChangeMapSchema = True
	Else
		ChangeMapSchema = False
	End If
End Function