Results 1 to 1 of 1

VB error for HTTP status request - Operation time out

Threaded View

  1. #1
    Registered User
    Join Date
    03-20-2009
    Location
    India, Mumbai
    MS-Off Ver
    Excel 2007
    Posts
    18

    VB error for HTTP status request - Operation time out

    Hi have a code which check the http status of the URL but the problem is that I have around 25000 URL's for which I need to check http staus & this code always keeps givin me runtime error "Operation time out"(screen shot attached). please help me with as i can't leave my system unattained following is the code:
    Sub Get_Http_Request_Status()
    
        Dim HttpRequest As WinHttpRequest
        Dim lastRowColumnE As Long, row As Long
        
        Set HttpRequest = New WinHttpRequest
    '    Set objWinHttpRequest = Server.CreateObject("WinHttp.WinHttpRequest.5")
    '    var WinHttpRequest = new ActiveXObject("WinHttp.WinHttpRequest.5.1")
    '    WinHttpRequest.SetTimeouts 30000, 30000, 90000, 90000
    '    objWinHttpRequest.SetTimeouts 30000, 30000, 70000, 70000
    '    Return Value = WaitForResponse( Timeout = -1)
        
        With Worksheets("URL_Status_Check")
        
            lastRowColumnE = .Cells(.Rows.Count, "E").End(xlUp).row
            If lastRowColumnE = 1 And .Cells(lastRowColumnE, "E").Value = "" Then lastRowColumnE = 0
    
            For row = 2 To lastRowColumnE
            
                If .Cells(row, "E").Value <> "" Then
            
                    HttpRequest.Open "GET", .Cells(row, "E").Value, False
                    HttpRequest.Send
                    
                    'Put status code and text in adjacent columns
                    
                    .Cells(row, "J").Value = HttpRequest.Status
                    .Cells(row, "K").Value = HttpRequest.StatusText
                
                End If
            
            Next
        MsgBox "All URL's Checked"
        End With
        
        Set HttpRequest = Nothing
        
    End Sub
    also is there any way that it can track the redirected url & page title of each url n store it in adjacent column.

    thanks in advance!!
    Attached Images Attached Images
    Last edited by Leith Ross; 10-19-2009 at 03:06 PM. Reason: Added Code Tags

Thread Information

Users Browsing this Thread

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

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