I am trying to help someone with a vba code to close internet explorer.
They were using
Dim URL As String
URL = "www.google.com"
ActiveWorkbook.FollowHyperlink URL
Now how do I close the browser window/tab in VBA?
I advised them to use
Sub Test()
Dim ie As InternetExplorer
Set ie = New InternetExplorer
ie.navigate "Google"
ie.Visible = True
Application.Wait (Now + TimeValue("00.00.05"))
ie.Quit
End Sub
They have now come back with
When I try to open Google it works fine.
But when I try to open a webpage in the intranet of my company (different network not internet!), It opens the right intranet web page, but won't close it.
Any ideas as to what could be wrong ?
In my basic understanding if it opens IE to the internet and then closes Ie I do not understand why the intranet would interfere.
It looks to me to be a simple
Open ie
Quit ie.
Cheers
PeterOz
They were using
Dim URL As String
URL = "www.google.com"
ActiveWorkbook.FollowHyperlink URL
Now how do I close the browser window/tab in VBA?
I advised them to use
Sub Test()
Dim ie As InternetExplorer
Set ie = New InternetExplorer
ie.navigate "Google"
ie.Visible = True
Application.Wait (Now + TimeValue("00.00.05"))
ie.Quit
End Sub
They have now come back with
When I try to open Google it works fine.
But when I try to open a webpage in the intranet of my company (different network not internet!), It opens the right intranet web page, but won't close it.
Any ideas as to what could be wrong ?
In my basic understanding if it opens IE to the internet and then closes Ie I do not understand why the intranet would interfere.
It looks to me to be a simple
Open ie
Quit ie.
Cheers
PeterOz