当我尝试使用vba(excel)访问common / example api url时,没有问题。
所需的URL如下:"hppts://user:password@www.site.com/events/"
当我在Web浏览器中复制URL时,没有问题。
但是在使用VBA时返回错误:“打开对象IServerXMLHTTPRequest2的方法失败”
代码:
Dim http As Object, str As Variant
Set http = CreateObject("MSXML2.XMLHTTP")
With http
.Open "GET", "https://user:password@www.site.com/events/", False
.send
str = .responseText
End With
x = UBound(str)