Results 1 to 1 of 1

URL Code reciving 440 error

Threaded View

  1. #1
    Registered User
    Join Date
    01-27-2009
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    54

    URL Code reciving 440 error

    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
    Attached Images Attached Images
    Last edited by k2hunter; 02-11-2019 at 03:28 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Need error handler code to avoid pivot table refreshing error if no data is available
    By adelkam in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-04-2015, 12:37 PM
  2. Need to add if error code to worksheet change event to stop a run-time error
    By KT99 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-18-2014, 03:10 PM
  3. Introduction, Hi everyone looking forward to helping and reciving help!!
    By shaun lawrence in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 05-22-2014, 10:45 AM
  4. Replies: 4
    Last Post: 11-15-2013, 05:03 PM
  5. VBA Code...error = run time error 1004 autofilter method of range class failed
    By Dariusd7 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-15-2013, 04:49 PM
  6. [SOLVED] Getting Error 1004 Object or Application Defined Error - Code to rearrange data
    By BlazzedTroll in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 06-10-2013, 12:10 PM
  7. Error 424 Object Required Error when Using AddItem to ListBox Generated in Code
    By jclark419 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-01-2010, 12:47 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1