Hi I keep receiving an error on this code 440. Automation error.
I've added several references (attached)
Any help would be appreciated thanks.
The links are Servers some produce "Continue to this website (not recommended). "
Sub CheckURLs()
Dim request As Object
Dim ws As Worksheet
Dim lr As Long, i As Long
Dim url As String
Set request = CreateObject("winhttp.winhttprequest.5.1")
Set ws = ThisWorkbook.Worksheets("Sheet1")
'last row with data in column A:
lr = ws.Range("A" & Rows.Count).End(xlUp).Row
For i = 2 To lr
next_row:
With request
On Error GoTo haveError
url = ws.Range("A" & i).Value
'if the url in the cell doesn't start with http://
'If Not url Like "http*" Then url = "http://" & url
.Open "head", url
.Send
.WaitForResponse 10
ws.Range("B" & i).Value = .GetResponseHeader
End With
Next i
Exit Sub
Bookmarks