我试图从Excel VBA(使用oauth2)向SFDC调用REST,但每次收到错误消息"错误:-2147012894 - 超时错误"在" Http1.send"线。下面的代码在另一台机器上工作正常。两台机器都有 Excel 2007 Windows 7
代码:
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
请帮助,如果有人遇到过这种类型的错误。非常赞赏。
谢谢