VBA WinHttp请求:参数不正确(错误80070057)

时间:2011-12-16 09:37:54

标签: vba proxy google-analytics winhttp

我有这个脚本来自动获取Google Analytics结果,它已经运行了一年多。突然间它停止了工作。

我收到错误80070057:参数不正确

这是代码。是的,我正在使用代理。

错误发生在第一个SetRequestHeader

Dim WinHttpReq As WinHttp.WinHttpRequest
    ' Create an instance of the WinHTTPRequest ActiveX object.
    Set WinHttpReq = New WinHttpRequest

    ' Assemble an HTTP Request.
    WinHttpReq.Open "GET", url, False
    WinHttpReq.SetProxy HTTPREQUEST_PROXYSETTING_PROXY, "http://webproxy.vum.be:8080"
    WinHttpReq.SetRequestHeader "Authorization", "GoogleLogin Auth=" & auth
    WinHttpReq.SetRequestHeader "GData-Version", 2

' Send the HTTP Request.
    WinHttpReq.Send

    ' Put status and content type into status text box.
    strStatus = WinHttpReq.STATUS & " - " & WinHttpReq.StatusText
    'Debug.Print "Status: " & strStatus

    If Body = True Then
        get_url_google = WinHttpReq.ResponseText
    Else
        get_url_google = strStatus
    End If

1 个答案:

答案 0 :(得分:1)

这是谷歌的错。 “auth”变量被误认为,在认证过程中谷歌要求验证码。