Friday, November 30, 2018

Open Internet explorer and navigate to an url and wait some seonds using VBA ,VBA Teacher Sourav,Kolkata 08910141720

Sub ienavigate()

Dim ie As Object
Set ie = CreateObject("internetexplorer.application")
With ie

    .Visible = True
    .navigate "https://www.google.com"
    'to make the page load so that it will not close in fraction of second
    'to make the internet explorer wait
    'it should do some events
    Do While .busy
   
    DoEvents
   
    Loop
   
    'now if the internet explorer is not fully loaded it should do some events
   
    Do While .readystate <> 4
       
    DoEvents
   
    Loop
   
   
    'to make this application wait for 5 seconds
    Application.Wait (Now + TimeValue("00:00:05"))
   
   
    .Quit
   
   
End With


End Sub

No comments:

Post a Comment