Wondering if i get get some help solving an issue, i use this code to get data from a website, however the site in questions always blocks the first attempt, after that it works fine, unless i leave it more than about 10 minutes then it blocks the first attempt again with an error "access denied" i need some sort of error code checking added to my code so they it will send the request again until it is accepted.
- Code: Select all
Public Function ExecuteWebRequest(url As String) As String
Dim oXHTTP As Object
Set oXHTTP = CreateObject("MSXML2.XMLHTTP")
oXHTTP.Open "GET", url, False
oXHTTP.send
ExecuteWebRequest = oXHTTP.responseText
Set oXHTTP = Nothing
End Function