''外資買賣資訊
Set WinHttpReq = CreateObject("MSXML2.XMLHTTP")
With WinHttpReq
.Open "GET", myURL, False
.Send
myURL = .responseText
End With
Set oStream = CreateObject("ADODB.Stream")
With oStream
.Open
.Type = 1
.Write WinHttpReq.responseBody
fileidx = Sheets("Config").Range("G2") & "\A" & fileidx & ".csv" ''設定下載路徑及檔名
On Error Resume Next
Kill fileidx
On Error GoTo 0
.SaveToFile fileidx
.Close
End With
Set WinHttpReq = Nothing
Set oStream = Nothing
Set WinHttpReq = CreateObject("MSXML2.XMLHTTP")
With WinHttpReq
.Open "POST", myURL, False
.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
.setRequestHeader "Content-Length", Len(sPost)
.send (sPost)
End With