I have the following code in excel VBA, and it worked well until yesterday. Now it fails when trying to check the URL.. but the URL does exist!
It fails in line: oXHTTP.send (it goes to haveError)
Function HttpExists(sURL As String) As Boolean
Dim oXHTTP As Object
Set oXHTTP = CreateObject("MSXML2.XMLHTTP")
If Not UCase(sURL) Like "HTTP:*" Then
sURL = "http://" & sURL
End If
On Error GoTo haveError
oXHTTP.Open "HEAD", sURL, False
oXHTTP.send
HttpExists = IIf(oXHTTP.status = 200, True, False)
Exit Function
haveError:
HttpExists = False
End Function
sURL is the following, which does exist:
What can be the problem?
Thanks