I am completely new to VBA and I was recently using to get HTTP status for the website using the following code
It just gives the message as 404 or 200. There is no details in it. I would like to add a small text like 200 Working and 404 Error like this. Can some help me with this. Please......
VBA Code:
Public Function CheckURL(url As String)
Dim request As Object
Set request = CreateObject("Winhttp.WinhttpRequest.5.1")
On Error GoTo haveError
With request
.Open "HEAD", url
.Send
CheckURL = .Status
End With
Exit Function
haveError:
CheckURL = Err.Description
End Function
It just gives the message as 404 or 200. There is no details in it. I would like to add a small text like 200 Working and 404 Error like this. Can some help me with this. Please......