Kevin07003
2008-03-16 19:54:00 UTC
Hello,
I'm trying to use the XMLHTTP object from the MSXML2 library in Outlook VBA.
I get a compile error "Expected: =" on the "oReq.Open" command.
There may be a better way to send an HTTP Request and get the XML response
from VBA. If so, please let me know...
Here is my code:
Private Sub TestXMLHTTP()
Dim strURL As String
Dim oReq As XMLHTTP
On Error GoTo ErrRoutine
strURL =
"http://local.yahooapis.com/MapsService/V1/geocode?appid=YahooDemo&street=701+First+Ave&city=Sunnyvale&state=CA"
MsgBox (strURL)
oReq.Open("GET", strURL, False)
oReq.Send
Debug.Print oReq.responseText
Set oReq = Nothing
MsgBox (oReq.responseText)
EndRoutine:
Exit Sub
ErrRoutine:
MsgBox Err.Number & " - " & Err.Description, _
vbOKOnly Or vbCritical, _
"TestXMLHTTP"
GoTo EndRoutine
End Sub
Thanks for your help!
Kevin
I'm trying to use the XMLHTTP object from the MSXML2 library in Outlook VBA.
I get a compile error "Expected: =" on the "oReq.Open" command.
There may be a better way to send an HTTP Request and get the XML response
from VBA. If so, please let me know...
Here is my code:
Private Sub TestXMLHTTP()
Dim strURL As String
Dim oReq As XMLHTTP
On Error GoTo ErrRoutine
strURL =
"http://local.yahooapis.com/MapsService/V1/geocode?appid=YahooDemo&street=701+First+Ave&city=Sunnyvale&state=CA"
MsgBox (strURL)
oReq.Open("GET", strURL, False)
oReq.Send
Debug.Print oReq.responseText
Set oReq = Nothing
MsgBox (oReq.responseText)
EndRoutine:
Exit Sub
ErrRoutine:
MsgBox Err.Number & " - " & Err.Description, _
vbOKOnly Or vbCritical, _
"TestXMLHTTP"
GoTo EndRoutine
End Sub
Thanks for your help!
Kevin