Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- With CreateObject("MSXML2.xmlHttp")
- .Open "GET", "xxxxxxxxxxxxxxxxx", False
- .send
- resp = .responseText
- End With
- With CreateObject("MSXML2.xmlHttp")
- .Open "GET", "xxxxxxxxxxxxxxxxx", False
- .send
- resp = .responseText
- End With
- Dim WinHttpReq As Object, attempts As Integer
- attempts = 3
- On Error GoTo TryAgain
- TryAgain:
- attempts = attempts - 1
- Err.Clear
- If attempts > 0 Then
- Set WinHttpReq = CreateObject("Microsoft.XMLHTTP")
- WinHttpReq.Open "GET", url, False
- WinHttpReq.send
- If WinHttpReq.Status = 200 Then
- Set oStream = CreateObject("ADODB.Stream")
- oStream.Open
- oStream.Type = 1
- oStream.Write WinHttpReq.responseBody
- oStream.SaveToFile filePath, 2 ' 1 = no overwrite, 2 = overwrite
- oStream.Close
- End If
- End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement