Share via


_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.String

    Required Object. The XPath to query for.

  • SelectionNamespaces
    Type: System.Object

    Optional 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.Object

    Optional 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.

See Also

Reference

_Worksheet Interface

_Worksheet Members

Microsoft.Office.Interop.Excel Namespace