修改前:
'url = "http://hq.sinajs.cn/list=" & codeCol ''SINA接口
'With CreateObject("Microsoft.XMLHTTP")
' .Open "GET", url, False
' .Send
' sTemp = .responseText
'End With
修改后:
url = "http://hq.sinajs.cn/list=" & codeCol
With CreateObject("WinHttp.WinHttpRequest.5.1")
.Open "GET", url, False
.setRequestHeader "Referer", "http://finance.sina.com.cn"
.Send
sTemp = .responseText
End With
'url = "http://hq.sinajs.cn/list=" & codeCol ''SINA接口
'With CreateObject("Microsoft.XMLHTTP")
' .Open "GET", url, False
' .Send
' sTemp = .responseText
'End With
修改后:
url = "http://hq.sinajs.cn/list=" & codeCol
With CreateObject("WinHttp.WinHttpRequest.5.1")
.Open "GET", url, False
.setRequestHeader "Referer", "http://finance.sina.com.cn"
.Send
sTemp = .responseText
End With