+ Reply to Thread
Results 1 to 4 of 4

Automated Internet - Alternatives to Busy and ReadyState?

  1. #1
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Automated Internet - Alternatives to Busy and ReadyState?

    I've run into a problem with automating internet explorer.

    I have been using
    Please Login or Register  to view this content.
    for some time.However I have a page I regularly access which has a link that uses javascript to launch a password window. This password window can meet the busy and readystate criteria well before it finishes loading. (And yes, it is the child window busy and readystate that I've been checking)

    Up to now I have been working around this by hardcoding a 12 second delay - but this is frustrating as sometimes the window loads in ~2 seconds so you are sitting there for 10 seconds waiting for the code to catch up. A few instances 12 seconds isn't enough and the code encounters an error as it is trying to process a page control that isn't loaded.

    Therefore I need an alternative method to test that the password window has completed loading before the code continues. Unfortunately I can't provide the webpage that launches that password window (as much as I know it would greatly improve the quantity of replies). But if anyone has an idea for me to test I'd be interested.


    (I suppose I could try using a Sleep loop to check for the existence of a known control on the password window - but I'll shelve that idea as a last resort. It seems extremely inefficient)
    *******************************************************

    HELP WANTED! (Links to Forum threads)
    Trying to create reusable code for Custom Events at Workbook (not Application) level

    *******************************************************

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Automated Internet - Alternatives to Busy and ReadyState?

    Hello mc84excel,

    If you are using Internet Explorer to access your web pages, the problem is Internet Explorer runs asynchronously with the VBA code. This makes it virtually impossible to sync the execution of one with the other.

    An alternative is to use the MSXML2 library. It will require more work on your end but it can run in sync with VBA.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Automated Internet - Alternatives to Busy and ReadyState?

    Thanks for the suggestion.

    I know a little of XML but not enough to deal with this particular site.

    I have since solved this by doing a Sleep loop and checking if the documents locationName = preset string. Messy but it works.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Automated Internet - Alternatives to Busy and ReadyState?

    Hello mc84excel,

    You're welcome. Glad you got it working.

    Now that you know there is another way, you should start learning how to use this library of functions. Especially if you want to delve deeper into using web automation.

+ 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] What are "ie.readyState" and "ie.Busy" for ?
    By HerryMarkowitz in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-18-2013, 04:24 AM
  2. Server too Busy
    By Mordred in forum Suggestions for Improvement
    Replies: 4
    Last Post: 08-01-2012, 12:47 PM
  3. Fill Form with VBA. Problems with .busy .readyState
    By Zheno in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-17-2012, 03:19 AM
  4. [SOLVED] Internet Explorer Automation from Excel and the ReadyState propert
    By rMartyr in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-03-2006, 06:50 PM
  5. readystate for an IE window that was not created in Excel
    By Necessitysslave in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-24-2006, 06:25 AM

Tags for this Thread

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