Results 1 to 2 of 2

Thread: check readystate twice

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2000
    Location
    Hong Kong
    Posts
    62
    I've got the following code. there are two Do Until... Loop in it. Is it illegal to have two of them? coz it's ok when I have only one of them my program hangs when I have two.

    Code:
    Private Sub Command1_Click()
        Webbrowser1.Navigate "http://www.abc.com./hello.asp"
        Do Until Webbrowser1.ReadyState = READYSTATE_COMPLETE
            DoEvents
        Loop
    
        SendKeys "{tab 8}"
        SendKeys "andy"    'input the search string to the text box
        SendKeys "{enter}" 'this "enter" submit the form and brings up another asp
        
        Do Until Webbrowser1.ReadyState = READYSTATE_COMPLETE
            DoEvents
        Loop
        Web1.SetFocus
    End Sub
    Please Visit My WebCam!!
    http://www.hmcheung.com

  2. #2
    Guest
    Why would it be illegal? If it works, than use it.

    You could have a DoEvents there which will also wait until the site has loaded completely before moving on to the next code.

    Code:
    Private Sub Command1_Click()
        Webbrowser1.Navigate "http://www.abc.com./hello.asp"
        DoEvents
        SendKeys "{tab 8}"
        SendKeys "andy"    'input the search string to the text box
        SendKeys "{enter}" 'this "enter" submit the form and brings up another asp
        
        Do Until Webbrowser1.ReadyState = READYSTATE_COMPLETE
            DoEvents
        Loop
        Web1.SetFocus
    End Sub

Posting Permissions

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



Click Here to Expand Forum to Full Width