[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

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

Posted on 2003-10-28
12
Medium Priority
?
363 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
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Suggested Courses

649 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