Worksheet.XmlDataQuery Method
Gets a Range object that represents the cells mapped to a particular XPath. Gets nulla null reference (Nothing in Visual Basic) if the specified XPath has not been mapped to the worksheet, or if the mapped range is empty.
Namespace: Microsoft.Office.Tools.Excel
Assemblies: Microsoft.Office.Tools.Excel (in Microsoft.Office.Tools.Excel.dll)
Microsoft.Office.Tools.Excel.v4.0.Utilities (in Microsoft.Office.Tools.Excel.v4.0.Utilities.dll)
Syntax
'Declaration
Function XmlDataQuery ( _
XPath As String, _
SelectionNamespaces As Object, _
Map As Object _
) As Range
Range XmlDataQuery(
string XPath,
Object SelectionNamespaces,
Object Map
)
Parameters
XPath
Type: System.StringThe XPath to query for.
SelectionNamespaces
Type: System.ObjectA space-delimited string that contains the namespaces referenced in the XPath parameter. A run-time error is generated if one of the specified namespaces cannot be resolved.
Map
Type: System.ObjectAn 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
A Range object that represents the cells mapped to a particular XPath; nulla null reference (Nothing in Visual Basic) if the specified XPath has not been mapped to the worksheet, or if the mapped range is empty.
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.
Optional Parameters
For information on optional parameters, see Optional Parameters in Office Solutions.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.