Aug 30 2021 10:10 AM
We have been developing an Excel/VBA program for over 20 years and it is up to 2000 lines of code and an extensive use of Excel spread sheet. Now that Edge has taken over IE. the our program no longer works. The need is to invoke a browser and set a URL. After one hour, the browser is to close and a new browser session will open with another URL. This has to be done without any manual intervention, not even a click.
The code has been working very well in IE but now that Edge has taken control, the code opens a new tab for each URL presented on the hour but the tab remains open. On the second hour, two URL/tabs are playing and for each subsequent hour, another URL/tab will be playing. At the moment, I have to be here on the hour to close the old tab(s). Since the program runs for 24 hours, my closing tabs manually is not an option. It has to be automated.
Here are the key commands I am using:
To open the browser from one sub:
Dim obj As Object
Set obj = CreateObject("InternetExplorer.Application") obj.Navigate ThisURL
And this code to close the browser from another sub:
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
Instances = Instances - 1
What is the new Edge code to open a browser for each hour and to close it after each hour. Also acceptable would be if there is code to open and close tabs.
I have about 400 members of the community who benefit from the output of this program so it is no trivial matter.
Aug 30 2021 12:09 PM - edited Aug 30 2021 12:11 PM
Two questions for you:
In the meantime, the notes below may help you and others in similar situations.
- Jim
Microsoft is committed to minimize impacts to existing applications from IE11 to Edge:
From this Windows IT Pro blog post:
If the support teams are contacted directly, then they will be more aware of your specific type of issue and may be able to make changes or publish guidance to better help others with similar issues in the future.
M365 customers with at least 150 seats (officially... there may be some flexibility there?) should probably start with App Assure via FastTrack, but there are options for everyone:
Apr 21 2022 08:12 AM
I am having a similar issue... but dont see an answer to it in your reply.
I also have a program in Excel vba which needs to open a browser like:
Set ie = CreateObject("InternetExplorer.Application")
With ie
.Visible = True
.navigate "https://www.example.com"
Do Until .readyState = 4: DoEvents: Loop ....................
The problem is that the code ALWAYS opens IE11. How can I have the code open Edge instead? what will happen after June 22 when IE gets deprecated?
Apr 28 2022 08:31 PM
May 19 2022 09:02 AM
@jkrafka Were you able to find a solution for this? I'm also encountering the same issue.
Dec 13 2022 10:24 AM - edited Dec 13 2022 12:24 PM
@iampacman Did you find a solution to this? Thanks.
Update: I found a solution, this worked for me it automatically selects edge.
loIE = createobject("shell.application")
loIE.ShellExecute(mcheck)
It didn't like the last part so I removed: loIE.visible = .t.