Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to close an existing IE window

Status
Not open for further replies.

mayankbhat

Programmer
Nov 26, 2011
1
US
I need to launch a new IE using an action and with another action I need to close that IE window that I created. Sounds simple but not for a rookie like me
Am able to open an IE

But how to close it from another action?
 
Am able to open an IE
How ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi ! Try This simple code !
Code:
Dim IE
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = 1
IE.navigate "[URL unfurl="true"]http://www.google.com"[/URL]
Do While (IE.Busy)
    WScript.Sleep 200
Loop
MsgBox "This Page will close in 10s",64,"Information"
wscript.sleep 10000 'Waiting for 10s
MsgBox "This Page will close Now after clicking on the OK Button !",64,"Information"
IE.Quit 
set IE = Nothing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top