XmlMappedRange Control

Applies to

The information in this topic applies only to the specified Visual Studio Tools for Office projects and versions of Microsoft Office.

Project type

  • Document-level projects

Microsoft Office version

  • Excel 2003

  • Excel 2007

For more information, see Features Available by Application and Project Type.

The XmlMappedRange control is a range that is created only when a non-repeating schema element is mapped onto a cell in Microsoft Office Excel. For example, when the maxOccurs attribute of a schema element equals 1. After Visual Studio Tools for Office creates the XML mapped range, you can program against it directly without having to traverse the Excel object model. You can only delete a XmlMappedRange control within Excel when the element mapping is removed.

link to video For a related video demonstration, see How Do I: Use XML Mapping in Excel?.

Binding Data to the Control

An XmlMappedRange control supports binding to a single data field (simple data binding). The ListObject control can supports complex data binding, and is automatically created when a repeating schema element is mapped onto a cell. For more information, see ListObject Control.

The XmlMappedRange control are bound to a data source using the DataBindings property. When an XmlMappedRange is added to a worksheet cell, Visual Studio Tools for Office automatically generates a data set from the data in the mapped cells, and binds the control to that data set. The default data binding property of the XmlMappedRange is Value2.

If the data in the bound data set is updated through any mechanism, the XmlMappedRange control reflects the changes.


You can apply the same formatting to an Microsoft.Office.Tools.Excel.XmlMappedRange control that you can apply to a Range. This includes borders, fonts, number format, and styles.


The events available for the XmlMappedRange control are:

See Also


How to: Add XMLMappedRange Controls to Worksheets

How to: Map Schemas to Worksheets Inside Visual Studio


Binding Data to Controls in Office Solutions

Programmatic Limitations of Host Items and Host Controls

Other Resources

Excel Host Controls

Word Host Controls