+ Reply to Thread
Results 1 to 4 of 4

Run-time error 5 - occasional HTML problem

  1. #1
    Registered User
    Join Date
    02-19-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2013
    Posts
    33

    Run-time error 5 - occasional HTML problem

    Hi everyone,

    I have a macro that runs through a column of URLs and extract the same data from each URL. The problem is that occasionally the macro errors with "Run-time error 5: Invalid procedure call or argument". It errors at the line: "RXLocation = InStr(URLLocation ..." When I manually visit the URL in IE it opens fine. Any ideas what is causing this problem?

    Please Login or Register  to view this content.
    Cheers, Rob

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Run-time error 5 - occasional HTML problem


    Hi,

    check variable value URLLocation ! If null, error occurs …

  3. #3
    Registered User
    Join Date
    02-19-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2013
    Posts
    33

    Re: Run-time error 5 - occasional HTML problem

    Hi Marc,

    Thanks for the reply. Yes, URLLocation = 0 when the error occurs. Most of the time it is good, sometimes bad

    Cheers, Rob

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Run-time error 5 - occasional HTML problem


    Check the value of READYSTATE_COMPLETE ?

    Bad if equals to zero ! 'Cause IE variable is defined in late binding … (no problem in early binding)

    So update with Loop Until IE.readyState = 4 …

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Run-time error '91' - Object variable or With block not set // getting HTML elements of we
    By Bootwalker in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-02-2014, 11:33 AM
  2. Newbie to forum and long time Excel novice in need of occasional help
    By safonso in forum Hello..Introduce yourself
    Replies: 2
    Last Post: 07-02-2013, 02:50 PM
  3. Problem with run time error 91 in macro
    By JFWeir in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-23-2011, 11:03 AM
  4. run time error 91 problem
    By stevesunfold in forum Excel Programming / VBA / Macros
    Replies: 28
    Last Post: 10-22-2008, 05:32 PM
  5. Run-time error 9 Problem
    By SamuelT in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-02-2005, 06:20 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