Excel VBA timeout error -2147012894

I tried to make a REST call to SFDC from Excel VBA (using oauth2), but every time I got the error "Error: -2147012894 - Timeout error" on line "Http1.send". Below code works fine on another machine. Both machines have Excel 2007 Windows 7

Code:

Dim Http1 As Object
Dim URL As String
URL = "https://test.salesforce.com/services/data/v32.0/sobjects/opportunity/describe"
On Error GoTo errorHandler
Set Http1 = CreateObject("MSXML2.ServerXMLHTTP")
Http1.Open "GET", URL, False
Http1.setTimeouts 0, 0, 0, 0
Http1.setRequestHeader "Authorization", "Bearer " & GetSetting("SF", "Tokens", "AccessKey") 'accesstoken
Http1.setRequestHeader "Content-Type", "application/json"
Http1.send
Set retrieveData = Http1
Set Http1 = Nothing
Exit Function

errorHandler:
MsgBox "Error : " & Err.Number & " - " & Err.description

      

Please help if anyone comes across this type of error. Much appreciated.

thank

+3


source to share





All Articles