What is the code to run IE in Edge?

%3CLINGO-SUB%20id%3D%22lingo-sub-2699491%22%20slang%3D%22en-US%22%3EWhat%20is%20the%20code%20to%20run%20IE%20in%20Edge%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2699491%22%20slang%3D%22en-US%22%3E%3CP%20class%3D%22x-hidden-focus%22%3EWe%20have%20been%20developing%20an%20Excel%2FVBA%20program%20for%20over%2020%20years%20and%20it%20is%20up%20to%202000%20lines%20of%20code%20and%20an%20extensive%20use%20of%20Excel%20spread%20sheet.%20Now%20that%20Edge%20has%20taken%20over%20IE.%20the%20our%20program%20no%20longer%20works.%20The%20need%20is%20to%20invoke%20a%20browser%20and%20set%20a%20URL.%20After%20one%20hour%2C%20the%20browser%20is%20to%20close%20and%20a%20new%20browser%20session%20will%20open%20with%20another%20URL.%20This%20has%20to%20be%20done%20without%20any%20manual%20intervention%2C%20not%20even%20a%20click.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20code%20has%20been%20working%20very%20well%20in%20IE%20but%20now%20that%20Edge%20has%20taken%20control%2C%20the%20code%20opens%20a%20new%20tab%20for%20each%20URL%20presented%20on%20the%20hour%20but%20the%20tab%20remains%20open.%20On%20the%20second%20hour%2C%20two%20URL%2Ftabs%20are%20playing%20and%20for%20each%20subsequent%20hour%2C%20another%20URL%2Ftab%20will%20be%20playing.%20At%20the%20moment%2C%20I%20have%20to%20be%20here%20on%20the%20hour%20to%20close%20the%20old%20tab(s).%20Since%20the%20program%20runs%20for%2024%20hours%2C%20my%20closing%20tabs%20manually%20is%20not%20an%20option.%20It%20has%20to%20be%20automated.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere%20are%20the%20key%20commands%20I%20am%20using%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETo%20open%20the%20browser%20from%20one%20sub%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDim%20obj%20As%20Object%3C%2FP%3E%3CP%3ESet%20obj%20%3D%20CreateObject(%22InternetExplorer.Application%22)%20obj.Navigate%20ThisURL%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnd%20this%20code%20to%20close%20the%20browser%20from%20another%20sub%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDim%20obj%20As%20Object%3A%20Dim%20ie%20As%20Object%3C%2FP%3E%3CP%3ESet%20obj%20%3D%20CreateObject(%22shell.application%22)%3C%2FP%3E%3CP%3EFor%20Each%20ie%20In%20obj.Windows%3C%2FP%3E%3CP%3EOn%20Error%20GoTo%20ForgetMe%3C%2FP%3E%3CP%3EIf%20TypeName(ie.Document)%20%3D%20%22HTMLDocument%22%20Then%3C%2FP%3E%3CP%3Eie.Quit%3C%2FP%3E%3CP%3EInstances%20%3D%20Instances%20-%201%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20is%20the%20new%20Edge%20code%20to%20open%20a%20browser%20for%20each%20hour%20and%20to%20close%20it%20after%20each%20hour.%20Also%20acceptable%20would%20be%20if%20there%20is%20code%20to%20open%20and%20close%20tabs.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%20class%3D%22x-hidden-focus%22%3EI%20have%20about%20400%20members%20of%20the%20community%20who%20benefit%20from%20the%20output%20of%20this%20program%20so%20it%20is%20no%20trivial%20matter.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2699934%22%20slang%3D%22en-US%22%3ERe%3A%20What%20is%20the%20code%20to%20run%20IE%20in%20Edge%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2699934%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1141579%22%20target%3D%22_blank%22%3E%40GaryTr755%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETwo%20questions%20for%20you%3A%3C%2FP%3E%3COL%3E%3CLI%3EIs%20your%20problem%20%3CSTRONG%3Enot%20being%20able%20to%20use%20your%20program%20to%20open%20a%20page%20%2F%20site%20in%20Edge%20using%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fdeployedge%2Fedge-ie-mode%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EIE%20mode%3C%2FA%3E%26nbsp%3Bat%20all%3C%2FSTRONG%3E%2C%20%3CEM%3Eor%3C%2FEM%3E%20is%20the%20issue%20that%20you%20%3CU%3Eare%3C%2FU%3E%20%3CSTRONG%3Eusing%26nbsp%3B%3CEM%3EIE%20Mode%3C%2FEM%3E%2C%20but%20Edge%20in%20%3CEM%3EIE%20Mode%3C%2FEM%3E%26nbsp%3Bis%20acting%20differently%20in%20some%20way%26nbsp%3B%3CEM%3E(i.e.%20in%20not%20allowing%20the%20tab%20to%20be%20closed%20on%20a%20timer)%3C%2FEM%3E%20than%20IE11%20does%3C%2FSTRONG%3E%3F%3C%2FLI%3E%3CLI%3E%3CSPAN%3EOn%20which%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fwww.microsoftedgeinsider.com%2Fen-us%2Fdownload%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Erelease%20channel(s)%3C%2FA%3E%3CSPAN%3E%26nbsp%3B%3CEM%3E(i.e.%20Public%2C%20Beta%2C%20Dev%2C%20or%20Canary)%3C%2FEM%3E%20of%20Edge%20have%20you%20experienced%20this%3F%3C%2FSPAN%3E%3C%2FLI%3E%3C%2FOL%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20the%20meantime%2C%20the%20notes%20below%20may%20help%20you%20and%20others%20in%20similar%20situations.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B-%20Jim%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CHR%20%2F%3E%3CP%3EMicrosoft%20is%20%3CA%20href%3D%22https%3A%2F%2Fblogs.windows.com%2Fwindowsexperience%2F2021%2F05%2F19%2Fthe-future-of-internet-explorer-on-windows-10-is-in-microsoft-edge%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ecommitted%20to%20minimize%20impacts%20to%20existing%20applications%3C%2FA%3E%20from%20IE11%20to%20Edge%3A%3C%2FP%3E%3CUL%3E%3CLI%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fdeployedge%2Fedge-ie-mode%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EInternet%20Explorer%20mode%3C%2FA%3E%20in%20Microsoft%20Edge%20will%20be%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Flifecycle%2Ffaq%2Finternet-explorer-microsoft-edge%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Esupported%20through%20at%20least%202029%3C%2FA%3E%3CSPAN%3E.%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3ESend%20us%20a%20note%20when%20you%E2%80%99re%20ready%20(%3CA%20href%3D%22mailto%3Aietoedge%40microsoft.com%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Eietoedge%40microsoft.com%3C%2FA%3E)%20and%20we%20can%20add%20your%20IE%20site%20to%20our%20list%20which%20will%20enable%20this%20transition%20experience.%20Learn%20more%20about%20how%20we%20can%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoft-edge%2Fweb-platform%2Fie-to-microsoft-edge-redirection%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehelp%20your%20IE%20users%20switch%20smoothly%3C%2FA%3E.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLI%3E%3C%2FUL%3E%3CHR%20%2F%3E%3CP%20data-unlink%3D%22true%22%3E%3CEM%3EFrom%20this%20Windows%20IT%20Pro%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fwindows-it-pro-blog%2Finternet-explorer-11-desktop-app-retirement-faq%2Fba-p%2F2366549%22%20target%3D%22_blank%22%3Eblog%20post%3C%2FA%3E%3A%3C%2FEM%3E%3C%2FP%3E%3CUL%3E%3CLI%3EApps%20developed%20for%20IE%20should%20work%20in%20Microsoft%20Edge%20through%20IE%20mode.%20If%20you%20encounter%20an%20issue%2C%20contact%20App%20Assure%20for%20remediation%20assistance%20(%3CA%20href%3D%22mailto%3AACHELP%40microsoft.com%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EACHELP%40microsoft.com%3C%2FA%3E).%3C%2FLI%3E%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoft-edge%2Fweb-platform%2Fie-to-microsoft-edge-redirection%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EIE%20to%20Microsoft%20Edge%20Redirection%3C%2FA%3E%3CUL%3E%3CLI%3EIt%20appears%20this%20is%20for%20the%20opposite%20case%20as%20yours%20%3CEM%3E(i.e.%20when%20a%20website%20is%20changed%20to%20make%20it%20incompatible%20with%20IE11)%3C%2FEM%3E%20but%20there%20may%20also%20be%20a%20whitelist%20for%20sites%20on%20which%20to%20enforce%20IE%20mode%20in%20Edge%3C%2FLI%3E%3C%2FUL%3E%3C%2FLI%3E%3C%2FUL%3E%3CHR%20%2F%3E%3CP%3EIf%20the%20%3CA%20href%3D%22https%3A%2F%2Fwww.microsoftedgeinsider.com%2Fen-us%2Fsupport%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Esupport%20teams%20are%20contacted%20directly%3C%2FA%3E%2C%20then%20they%20will%20be%20more%20aware%20of%20your%20specific%20type%20of%20issue%20and%20may%20be%20able%20to%20make%20changes%20or%20publish%20guidance%20to%20better%20help%20others%20with%20similar%20issues%20in%20the%20future.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EM365%20customers%20with%20at%20least%20150%20seats%20%3CEM%3E(officially...%20there%20may%20be%20some%20flexibility%20there%3F)%3C%2FEM%3E%20should%20probably%20start%20with%20%3CEM%3EApp%20Assure%20via%20FastTrack%3C%2FEM%3E%2C%20but%20there%20are%20options%20for%20everyone%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CUL%3E%3CLI%3ESupport%20for%20individuals%3CBR%20%2F%3E-------------------------%3CBR%20%2F%3ENeed%20assistance%20with%20Microsoft%20Edge%3F%20%3CA%20href%3D%22https%3A%2F%2Fwww.microsoftedgeinsider.com%2Fen-us%2Fsupport%2Frequest%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EFile%20a%20ticket%3C%2FA%3E%20and%20we'll%20be%20there%20to%20help.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%3ESupport%20for%20business%3CBR%20%2F%3E%3C%2FSPAN%3E-----------------------%3CBR%20%2F%3EMICROSOFT%20EDGE%20BETA%20ONLY%3CBR%20%2F%3E1%3A1%20help%20is%20available%20%3CA%20href%3D%22https%3A%2F%2Fgo.microsoft.com%2Ffwlink%2F%3Flinkid%3D2128271%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Evia%20a%20variety%20of%20plans%3C%2FA%3E%20to%20help%20you%20get%20the%20level%20of%20support%20you%20need.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLI%3E%3CLI%3EApp%20Assure%3CBR%20%2F%3E-------------%3CBR%20%2F%3EIssues%20with%20your%20business%20apps%20or%20websites%20on%20the%20latest%20version%20of%20Microsoft%20Edge%3F%20%3CA%20href%3D%22https%3A%2F%2Fgo.microsoft.com%2Ffwlink%2F%3Flinkid%3D2128079%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EMicrosoft%20will%20help%20you%20fix%20them%20at%20no%20additional%20cost%3C%2FA%3E.%3C%2FLI%3E%3C%2FUL%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

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.

1 Reply

@GaryTr755 

 

Two questions for you:

  1. Is your problem not being able to use your program to open a page / site in Edge using IE mode at all, or is the issue that you are using IE Mode, but Edge in IE Mode is acting differently in some way (i.e. in not allowing the tab to be closed on a timer) than IE11 does?
  2. On which release channel(s) (i.e. Public, Beta, Dev, or Canary) of Edge have you experienced this?

 

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:

  • Apps developed for IE should work in Microsoft Edge through IE mode. If you encounter an issue, contact App Assure for remediation assistance (ACHELP@microsoft.com).
  • IE to Microsoft Edge Redirection
    • It appears this is for the opposite case as yours (i.e. when a website is changed to make it incompatible with IE11) but there may also be a whitelist for sites on which to enforce IE mode in Edge

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:

 

  • Support for individuals
    -------------------------
    Need assistance with Microsoft Edge? File a ticket and we'll be there to help.

  • Support for business
    -----------------------
    MICROSOFT EDGE BETA ONLY
    1:1 help is available via a variety of plans to help you get the level of support you need.

  • App Assure
    -------------
    Issues with your business apps or websites on the latest version of Microsoft Edge? Microsoft will help you fix them at no additional cost.