+ Reply to Thread
Results 1 to 4 of 4

Need help with documentcomplete statement

  1. #1
    Registered User
    Join Date
    04-28-2004
    Posts
    49

    Need help with documentcomplete statement

    Hi,

    I am trying to find a more reliable event then do until readystate =4 and do while busy to grab a table from an intranet site once the page has fully loaded. I have noticed in some instances, especially when working remotely with a slower connection, my code executes before a table is fully loaded some i miss some rows of data intermittently.

    From my reading it looks like the documentcomplete event may be more reliable. This is not a multi frame webpage so I believe this event should be a better option, but I need a little help in implementing it in my code shown below. The issue really happens after the "ctl00_MainContentRegion_btnRunReport" button is clicked. This is when the table is loaded then i have code afterwards that reads the table into excel. Any help?

    Please Login or Register  to view this content.
    Last edited by bg18461; 05-24-2014 at 04:57 PM.

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Need help with documentcomplete statement

    The following seems to work better for me than just looking for ReadyState = 4. I'm no expert, it was just trial and error until I got a repeatable stable result.

    Please Login or Register  to view this content.
    Lewis

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Need help with documentcomplete statement

    I tend to add something like this to wait for both IE and the document being loaded in IE to be ready before the code continues.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  4. #4
    Registered User
    Join Date
    04-28-2004
    Posts
    49

    Re: Need help with documentcomplete statement

    Thank you LJ and Norie. I have used both and they seem successful. I will continue to test these options out over the next few days to see which to settle on. Thanks again!

+ 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. compile error expected line number statement end statement
    By mattress58 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-18-2014, 10:12 AM
  2. VBA Compile Error : line number or label or statement or end of statement
    By excellearner121 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2013, 06:41 PM
  3. Replies: 4
    Last Post: 06-01-2012, 10:05 AM
  4. Replies: 4
    Last Post: 05-16-2012, 05:33 PM
  5. [SOLVED] Utilize a Select Case Statement in Target Intersect Statement
    By max57 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-29-2009, 08:55 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