-
Solved: how do I close other app with vba
Hi,
I am working with vba in excel 2003 and have the following problem. I need to open internet explorer and then latter I need to close it. I can open it with:
[VBA]Public Sub OpenInetExplorer()
ActiveWorkbook.FollowHyperlink "http://www.google.com"
End Sub
[/VBA]
But I have not been able to find a way to close it useing vba.
Can anyone help, please?
Thanks,
dmat619
-
try this:
[VBA]
Sub Demo()
Dim ie As Object
Set ie = CreateObject("InternetExplorer.Application")
ie.navigate "http://www.google.com/"
Do While ie.busy And Not ie.readystate = 4
DoEvents
Loop
ie.Visible = True
Application.Wait Now + TimeSerial(0, 0, 5)
ie.Quit
Set ie = Nothing
End Sub
[/VBA]
this should close IE windows
[VBA]ie.Quit[/VBA]
-
Thanks
Thanks MaximS,
That worked perfect. I was afraid I would have to use API calls. Your solution was both simple and easily understandable.
Thanks again,
dmat619
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules