_Worksheet.XmlDataQuery Method
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.
Namespace: Microsoft.Office.Interop.Excel
Assembly: Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)
Syntax
'Declaration
Function XmlDataQuery ( _
XPath As String, _
SelectionNamespaces As Object, _
Map As Object _
) As Range
'Usage
Dim instance As _Worksheet
Dim XPath As String
Dim SelectionNamespaces As Object
Dim Map As Object
Dim returnValue As Range
returnValue = instance.XmlDataQuery(XPath, _
SelectionNamespaces, Map)
Range XmlDataQuery(
string XPath,
Object SelectionNamespaces,
Object Map
)
Parameters
XPath
Type: System.StringRequired Object. The XPath to query for.
SelectionNamespaces
Type: System.ObjectOptional Object. 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
Type: System.ObjectOptional XmlMap. Specify an XML map if you want to query for the XPath within a specific map.
Return Value
Type: Microsoft.Office.Interop.Excel.Range
Remarks
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.
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.