Results 1 to 6 of 6

Thread: ReadyState check not working in IE11
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Nov 2013
    Posts
    22
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default ReadyState check not working in IE11

    I had automated an internal application (IE) in my company using excel macro. In the code i have used readystate property of the document object to determine whether the page is loaded or not. Now when I upgraded my IE to IE11, ready state function is not working. When googled came to know that property is removed from IE1 onwards. Not able to find any alternative for ready state. Requesting your help.

    As the application is in my companys intranet, not possible to paste the URL.

    Piece of code am referring to is updated below. In that ReqResWindow is the IE Object and DocObjReqRes is a document object.

    Set DocObjReqRes = ReqResWindow.Document
    Do
    DocObjReqResReadyState = DocObjReqRes.ReadyState
    Loop Until DocObjReqResReadyState = "complete"

  2. #2
    Board Regular
    Join Date
    Apr 2010
    Location
    New Delhi, India
    Posts
    292
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: ReadyState check not working in IE11

    try this if it work .....
    Code:
    DoRepeatLoop
    While DocObjReqResReadyState.Busy
            Application.Wait Now + TimeValue("0:00:1")
            GoTo DoRepeatLoop
        Wend
    Thanks

    Purushottam
    Excel 2010 , Windows 7

  3. #3
    New Member
    Join Date
    Nov 2013
    Posts
    22
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: ReadyState check not working in IE11

    But will readystate work in IE11?

  4. #4
    Board Regular
    Join Date
    Apr 2010
    Location
    New Delhi, India
    Posts
    292
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: ReadyState check not working in IE11

    I believe you may refer this

    readyState property (Internet Explorer)
    Thanks

    Purushottam
    Excel 2010 , Windows 7

  5. #5
    Board Regular
    Join Date
    Jul 2012
    Posts
    121
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: ReadyState check not working in IE11

    Quote Originally Posted by puru.sve View Post
    I believe you may refer this

    readyState property (Internet Explorer)



    do while ie.document.readystate= "Complete"
    doevents
    loop

  6. #6
    New Member
    Join Date
    Mar 2019
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: ReadyState check not working in IE11

    Hi, I have found a solution to this, not sure if others would recommend it but i found that with some pages, when you log into a page, the do until readystate_complete doesn't work. I have used the below and it works perfectly, I hope it helps you and others looking for a solution!



    wait1:
    On Error Resume Next
    If htmldoc.getElementById("myaccountpage:filterForm:searchFilterText").placeholder <> "filter on bill, property, meter & spids" Then
    Application.Wait (Now + TimeValue("00:00:01"))
    DoEvents
    GoTo wait1
    End If


    to explain, it is looking for a certain element on the loaded page(once you have logged in), and will keep looping until it finds it, it used the 'on error resume next' function to bypass the error it throws up when it can't find the ID, it will only continue when it finds that ID (when the page has loaded)

    to explain my dims:

    dim IE as internet explorer
    dim htmldoc as HTMLDocument
    set htmldoc = ie.document


    i have used the 'get elementbyID but i'm sure it will work with getelementbyclassname or other get element functions.

    the .placeholder refers to text within text box HTML of that ID below:

    <input name="myaccountpage:filterForm:searchFilterText" id="myaccountpage:filterForm:searchFilterText" style="width: 40%;" onkeydown="if(event.keyCode==13){return false;}" type="text" <u=""> placeholder="filter on bill, property, meter & spids">

    I do hope my explanation helps others with this issue as i couldn't find a solid answer anywhere, I had to come up with this myself!
    Last edited by TheEnergyMan; May 24th, 2019 at 06:30 AM.

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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