Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Excel HTTP请求超时_Excel_Vba_Winhttprequest_Request Timed Out - Fatal编程技术网

Excel HTTP请求超时

Excel HTTP请求超时,excel,vba,winhttprequest,request-timed-out,Excel,Vba,Winhttprequest,Request Timed Out,我正在尝试检查网页是否已登录。为此,我使用WinHTTPGET请求对google进行了测试。但是我越来越 “操作超时”错误 在发送命令之后 还尝试了xmlHTTP和serverxmlHTTP Dim xmlHTTP As Object Dim html As Object Dim url As String url = "https://www.google.com/" ' 'Set xmlHTTP = CreateObject("MSXML2.XMLHTTP") Set xmlHTTP

我正在尝试检查网页是否已登录。为此,我使用WinHTTPGET请求对google进行了测试。但是我越来越

“操作超时”错误

在发送命令之后

还尝试了xmlHTTP和serverxmlHTTP

Dim xmlHTTP As Object
Dim html As Object
Dim url As String


url = "https://www.google.com/"

'
'Set xmlHTTP = CreateObject("MSXML2.XMLHTTP")

Set xmlHTTP = CreateObject("WinHttp.WinHttpRequest.5.1")

xmlHTTP.SetTimeouts 10000, 10000, 10000, 10000


xmlHTTP.Open "GET", url, False
'xmlHTTP.setRequestHeader "Content-Type", "text/xml"
xmlHTTP.send

Set html = CreateObject("htmlfile")
html.body.innerHTML = xmlHTTP.responseText

发送命令后出现“操作超时”错误。

html.body.innerHTML=xthemlhtp.responseText
如果未定义
“xthemlhtp”
,则无法工作。可能
html.body.innerHTML=xmlHTTP.responseText
?很抱歉在此处发布时出现waws打字错误。我已经编辑了信息。我已经尝试了你的代码,它正在工作。您能显示您的错误吗?这里也是,除了使用
Set-xmlHTTP=CreateObject(“MSXML2.ServerXMLHTTP”)
而不是
Set-xmlHTTP=CreateObject(“MSXML2.xmlHTTP”)
,因为后者不支持
。settimeout
。可与WinHTTP和MSXML2一起使用。所以我怀疑你那边有某种干扰(防火墙/AV软件)。这里没有超时错误。