XmlDataQuery Method

Microsoft Excel Visual Basic

XmlDataQuery Method

Note  XML features, except for saving files in the XML Spreadsheet format, are available only in Microsoft Office Professional Edition 2003 and Microsoft Office Excel 2003.

Returns a Range object that represents the cells mapped to a particular XPath. Returns Nothing if the specified XPath has not been mapped to the worksheet, or if the mapped range is empty.

expression.XmlDataQuery(XPath, SelectionNamespaces, Map)

expression    Required. An expression that returns a Worksheet object.

XPath   Required String. The XPath to query for.

SelectionNamespaces   Optional String. A space-delimited String that contains the namespaces referenced in the XPath parameter. A run-time error will be generated if one of the specified namespaces cannot be resolved.

Map   Optional XmlMap. Specify an XML map if you want to query for the XPath within a specific map.

Remarks

If the XPath exists within a column in an XML list, the Range object returned does not include the header row or the Insert row.