|Excel Developer Reference|
expression A variable that represents a Range object.
The XPath property is valid when the range it contains meets the following conditions:
- The range is a single cell.
- If the range consists of two or more cells, then one or the other must be true:
- If the cells contain XPath information, then all cells in the range must contain XPath information (that is, each cell is associated with one or more data maps), and all of the cells must have identical XPath content (that is, each cell contributes to the same set of data maps).
- All of the cells must contain no XPath information.
- The range does not contain discontinuous areas.
Note The header and totals row of a table are considered to contain XPath information.
Any ranges that don't meet the above conditions returns a runtime error.
If the range selection is valid, but none of the cells are mapped, Excel returns an XPath object so that you can access the SetValue method to create a mapping.