Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I am getting a error with XmlDataQuery

Status
Not open for further replies.

SJW62

Programmer
Aug 30, 2005
5
US
Can anyone tell me what is wrong with this code. I get the Error “Object variable or With block variable not set (Error 91)” This error occurs at run time.


Dim WSD As Worksheet

Set WSD = Worksheets("Sheet1")
WSD.XmlDataQuery(" ("A15")


Thank you,





Steve
 
Thanks PHV for the try but that gave me a compiler error.
 
Steve,

According to the VBA Help, the syntax for the XmlDataQuery method is
Code:
expression.XmlDataQuery(XPath, SelectionNamespaces, Map)
and returns a range mapped to XPath. You cannot tack a range reference onto the end of this method.


Regards,
Mike
 
Thanks for the help.
I saw that under help but the compiler shows “expression.XmlDataQuery(XPath, [SelectionNamespaces], [Map])As Range”. This has the “As Range” outside the brackets. Ether way how do I direct were the data goes?


Thank you,



Steve
 
Steve,

Not sure I can help with this, as I don't know what this function is actually doing (I don't even know what an XPath is!). However, from the Help entry:
XMLAvailabilityNoteReturns 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
it appears that something (i.e. mapping an XPath to a worksheet) needs to be in place beforehand.

Maybe someone else will weigh in on this.

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top