This one is strange.
The following sub is quite simple:
Private Sub YahooSearch
' Sub uses Yahoo REST based API
' Requires reference to Microsoft XML object library.
Dim xdoc As New DOMDocument
Dim num As Long
Dim search as string
' Create the search request
search
= "api.search.yahoo.com/WebSearchService/V1/webSearch" & _
"?appid=my_id" & _
"&query=" & "Ephraim Sevela we were not like other people" & _
"&results=1"
xdoc.Load search
'observation of xdoc in the Watch Window shows Yahoo!
'responded as expected
num = xdoc.childNodes.length '#### this is the problem line ####
End Sub ' #### this is were my breakpoint is located ####
I located a breakpoint at the last line. Using the Watch Window I
examined both sides of the problem line.
The value of xdoc.childNodes.length is 3, as indicated in the Watch
Window.
The value of num is 0.
The assignment operator "=" does not work. I do not get any error
message, or any other indication anything is wrong.
Other attempts I made to get other values from the XML document, such
as strings an objects, failed in a similar way. Strings remained
equal to the null string, objects I tried to set remained as
Nothing.
I have "Microsoft XML, version 2.0" reference checked.