I have an Excel-list of some URLs I want to check regularly, if they still exist. In some cases I get a 404 error eventhough the website exists (but some images on it produce 404 errors. My code is as follows:
Sub Schaltfläche1_Klicken()
Set sh = ThisWorkbook.Sheets("Tabelle1")
Dim column_number: column_number = 2
sh.Range("C2:D1000").Clear
i = 2
'Row starts from 2
Do Until sh.Cells(i, column_number).Value = ""
strURL = sh.Cells(i, column_number)
sh.Cells(i, column_number + 1) = CallHTTPRequest(strURL)
i = i + 1
Loop
End Sub
Function CallHTTPRequest(strURL)
Set objXMLHTTP = CreateObject("MSXML2.XMLHTTP")
objXMLHTTP.Open "GET", strURL, False
objXMLHTTP.Send
Status = objXMLHTTP.Status
Set objXMLHTTP = Nothing
CallHTTPRequest = Status
End Function
The problematic URL is http://www.ifz-berlin.de/#/rescue
Any help is appreciated on how I could solve this issue.