'The data necessary to complete this operation is not yet available VBA runtime error
I'm getting this runtime error 2147483638 from excel vba code editor. I'm trying to send to my web service xml string and get a response back from the web service. Seems like it errors out because the response is "". Here's my code:
......
OutboundDocument.LoadXML (XMLServiceString)
On Error GoTo DoThisAgain
XMLHTTPClient.Open "POST", WebServiceURL, False
XMLHTTPClient.Send (OutboundDocument)
'errors out here
DoThisAgain:
serviceResponse = XMLHTTPClient.ResponseText ' equals "" gets error
Solution 1:[1]
This can avoid the error:
Dim MyRequest As MSXML2.XMLHTTP
Set MyRequest = CreateObject("MSXML2.XMLHTTP.6.0")
With MyRequest
.Open "GET", <URL>
.send ""
MyResponse = MyRequest.responseText
End With
Solution 2:[2]
XMLHTTPClient.Open "POST", WebServiceURL, False
change above to true and make it synchronous (waits for response back before continuing)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Brian |
| Solution 2 | sabina |
