我正在尝试从具有auth系统的页面获取Excel中的VBA数据。我试过了SetCredentials
,但它不起作用。我应该做些额外的事情,或SetCredentials
只能在“真正的”http服务器身份验证系统上工作,而不能在rails / flash / django或任何类型的身份验证系统上使用“普通”php / ruby吗?
Sub Download()
Dim WinHttpReq
' Instantiate a WinHttpRequest object.
Set WinHttpReq = CreateObject("WinHttp.WinHttpRequest.5.1")
With WinHttpReq
' Initialize an HTTP request.
Call .Open("GET", "url", False)
' Set credentials
Call .SetCredentials("username", "password", 0)
' Send HTTP request
Call .Send
' Debug output
Debug.Print .ResponseText
End With
End Sub