2014-12-29

VBA - Excel web service call through XMLHttp

You will need a reference to the library "Microsoft XML, v6.0".


Sub getWebServiceX()

    Dim req As New MSXML2.XMLHttp

    req.Open _
        "GET" _
        , "http://www.webservicex.com/stockquote.asmx/GetQuote?symbol=GOOG" _
        , False
        
    req.send
    MsgBox req.responseText

End Sub

VBA - XMLHttp.open access is denied

If you get an access denied error, then your windows/internet explorer security settings might not be letting you access the URL being requested pro grammatically.


  • Use the URL over HTTPS if available (change the URL from http:// to https://).
  • Relax your security settings.