I have a program that has developed over the last 20 and now contains over 2000 lines of code and is now in jeopardy, approaching final jeopardy. The problem is the extinction of IE.
The code uses the following code to open the IE browser and run a given URL:
Dim obj As Object
Set obj = CreateObject("InternetExplorer.Application") obj.Navigate ThisURL
Interestingly enough, it opens Edge and does activate the URL.
However, on the end of an hour after activating that browser instance, the following code that used to close the IE browser fails to close it in Edge. That code is in another sub() as follows.
Dim obj As Object: Dim ie As Object
Set obj = CreateObject("shell.application")
For Each ie In obj.Windows
On Error GoTo ForgetMe
If TypeName(ie.Document) = "HTMLDocument" Then
ie.Quit
A token URL can be:
ThisURL = "http://player.streamguys.com/gpb/sgplayer"
Now that I have to use Edge, all I am getting is tab after tab open to various URLs and I end up with many broadcasts running all at once. Tabs are not closing as needed.
How do I close the browser/tab on command from my program There can be no manual action required. It has to be automated.
I have 400 residents that benefit from this program so this is no trivial matter.