Solved

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

Posted on 2003-10-28
12
338 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
  • 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
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 25 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 25 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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone 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

Suggested Solutions

Title # Comments Views Activity
vb6 connector to SQL Server 2 37
Having a different time zone on your task bar 3 70
Modifying Conditional Format from VBA code 3 59
Recommendation vb6 to vb.net or others 14 174
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

792 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