仅在第一次执行时导致运行时错误的VBA代码

时间:2017-05-29 05:26:24

标签: vba excel-vba runtime-error soap-client excel

请在第一时间找到导致运行时错误的代码。所以状态值没有正确更新。我可以在第一次看到它是空的。

Sub test()
Dim http As Object
Set http = CreateObject("MSXML2.XMLHTTP")
http.Open "GET", "http://localhost:8080/(soap query)", True
http.send
Application.Wait Now + TimeValue("0:00:10")
On Error Resume Next
If http.Status <> 200 Then
Debug.Print "no response"
Debug.Print http.Status
End If

Debug.Print "response"
Debug.Print http.Status

End Sub

0 个答案:

没有答案