?
Solved

How can I know if an Internet Explorer finish loading in Visual Basic?

Posted on 2003-10-28
12
Medium Priority
?
358 Views
Last Modified: 2013-11-25
I know how to open an Internet Explorer using Visual Basic, however, I try to use keyboard_event to fill in some texts in the form in the homepage in Internet Explorer and submit that form, however, I do not know if the Internet Explorer finish loading. Would somebody tell me how can i know if an Internet Explorer finish loading in Visual Basic ? I want to know if Internet Explorer finish loading because I cannot fill in the textbox and submit the form until the internet explorer finsih loading.
0
Comment
Question by:mikekwok
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
  • +3
12 Comments
 
LVL 48

Expert Comment

by:Mikal613
ID: 9638740
wait for single process
0
 

Author Comment

by:mikekwok
ID: 9638752
What do u mean wait for single process ? Would you please tell me more details ?
0
 
LVL 48

Expert Comment

by:Mikal613
ID: 9638783
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 14

Expert Comment

by:aelatik
ID: 9639641
Can you post the code on how you start IE. Are you using Shell object or IE object ?
0
 

Author Comment

by:mikekwok
ID: 9639676
I start my IE in VB using the following lines :

Set IE = CreateObject("InternetExplorer.Application")
    IE.Navigate "http://www.google.com"
    IE.Visible = True
    Do While IE.Busy
       DoEvents
    Loop


Would you please help me ?
0
 

Author Comment

by:mikekwok
ID: 9639815
I think I have already answered my question by myself :

the code for me to test after internet explorer finish loading is :

Do While IE.Busy
       DoEvents
    Loop

0
 
LVL 17

Assisted Solution

by:zzzzzooc
zzzzzooc earned 100 total points
ID: 9640302
You did answer it yourself, but here's another method:

Private Sub Form_Load()
    Dim IE As Object
    Set IE = CreateObject("InternetExplorer.Application")
    IE.Navigate "http://www.google.com"
    IE.Visible = True
    Do Until IE.ReadyState = 4
       DoEvents
    Loop
    MsgBox IE.document.body.outerhtml
End Sub


ReadyState_Complete = 4
0
 
LVL 5

Accepted Solution

by:
fantasy1001 earned 100 total points
ID: 9647702
Mike,
I think I found the way to load the text effectively into the html input box
Dim IE
Set IE = CreateObject("InternetExplorer.Application")
  IE.Navigate "http://www.google.com"
  IE.Visible = True
 
   While IE.Busy
      DoEvents
  Wend
IE.Document.All("q").Value = "My Name" ' contains the HTML name of the object
IE.Document.All("btnG").Click ' contains the HTML name of the object
end sub
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9650901
Delete?, why?, there are a bunch of useful data to solve asker's problem!!!
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9650948
never mind. Sorry. :P
0
 

Author Comment

by:mikekwok
ID: 9926507
Public Sub click_Security_dialog(Language As String)
    On Error GoTo ErrorHandler
    If Language = "e" Then
        AppActivate "Security Information"
    ElseIf Language = "tc" Then
        AppActivate "安全性資訊"
    End If
    Dim clskey As New clsKeyboard
    Call clskey.PressKeyVK(keyReturn)
    Exit Sub
ErrorHandler:
Wait 1
Resume
End Sub

This code is for pressing dialog when internet explorer open. But it doesn't work when i try to open more than 1 internet explorer using visual basic and in these internet explorers pop up dialogs.

would some body tell me how to solve my problem ?  my program open 2 browsers and 2 pop up dialog and i need to press enter on that. it sometimes work but it sometimes doesn't work using the code above.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question