I’m always amazed at the level of pure stupidity that Microsoft exudes at times!
I know, we all have our moments in the sun, myself included, but Microsoft just seems to manage to outdo themselves.
I’m well aware that in an ideal world, Microsoft wants us all running MS365 and thus we would have all migrated all of our existing Web Browser controls to use the ‘new’ Modern Web Browser control, but that isn’t reality, not even close! The fact of the matter, the legacy Web Browser control is still fully supported and thus why fix something that isn’t broken. Beyond which, many people are simply not running MS365 so they don’t even have access to the Modern Web Browser control at all.
All of this to say, that many a database are still using the ‘Legacy’ Web Browser control, thus IE (Internet Explorer)!
Now, anyone that does serious development knows, that unlike the Modern Web Browser control, with the Legacy Web Browser control one of the best approaches is to do the development outside of Access, so using your editor of choice (NotePad++, VSCode, SublimeText, …) and then testing directly in IE. Then once you have that functional, bring the file into Access.
For very basic, self-contained HTML pages you can still do testing, but for anything that uses external resources/libraries this new requirement makes local testing impossible in Edge (or another browser of choice) and we are restricted to only doing development via Microsoft Access directly.
Nothing like improvements!
Huston, We Have A MAJOR Problem!!!
Microsoft introduced the Edge browser, IE’s replacement and over time has made it the primary browser to the point now that it has become virtually impossible to open in any manner, thus making development impossible.
Using any links/shortcuts/menus to Internet Explorer all go and open Edge instead! That’s right, even when you explicitly go and try to open Internet Explorer, Microsoft overrules that action and opens Edge instead.
Whether they wish to admit or not, IE is still a fundamental component of many tools, and not just Access! With their forceful hand in pushing Edge in this manner they have shown a complete disregard for all their users and seriously crippled their developers!
IE based controls are still fully supported and will be for some time to come, so not allowing us to develop properly is plain STUPID. Now, I understand wanting to protect general users from using Internet Explorer, but not giving us some means to regain the ability to launch it, not giving us some Windows property to control this behavior is disrespectful to all the developers out there. Microsoft can claim whatever they want and say it’s in the name of safety. If that is true, then why are IE controls (Legacy Web Browser control) still fine to use then?! You can’t have your cake and eat it too.
Past Approaches That No Longer Work!
Windows Menu and Shortcuts
Yep, that’s right, using the default app button from your Windows Menu no longer works. Instead it launches Edge! The Same is true of any Desktop shortcuts that may exist on your system.
Command Prompt
This does NOT work! But, previously we could do:
"C:\Program Files\Internet Explorer\iexplore.exe" https://www.google.com
"C:\Program Files\Internet Explorer\iexplore.exe" "file://C:\Dev\slider.html"
"C:\Program Files\Internet Explorer\iexplore.exe" "about:blank"
Now, since some of the security updates, it launches Edge instead? Furthermore, running such commands actually triggers security warnings from Windows Security – Virus and threat protection!
Context Menu/Open With
Right-clicking on an HTML file and selecting Open with -> Internet Explorer from the context menu also results in Edge launching.
Edge – Open with Internet Explorer
I’ve seen people explain you can load a page in Edge and then go to the Main Menu -> More tools -> Open with Internet Explorer. Sadly, this option is not available on any of my PCs.
Some Workarounds
Over the years I have seen some workarounds come and go. So I present to you a few that currently seem to work as older approaches no longer do. Also, note that any of these could stop at any time. Remember, Microsoft does not want anyone using IE, at all!
VBScript
So, although we can’t launch IE via the command prompt, we can use VBScript!
Set oIE = CreateObject("InternetExplorer.Application")
oIE.Visible = true
Set oIE = CreateObject("InternetExplorer.Application")
oIE.Visible = true
oIE.Navigate "about:blank"
Set oIE = CreateObject("InternetExplorer.Application")
oIE.Visible = true
oIE.Navigate "file://C:\Dev\slider.html"
VBA
We can take the VBScript code and convert it to VBA and that too works
Sub LaunchIE()
Dim oIE As Object
Set oIE = CreateObject("InternetExplorer.Application")
oIE.Visible = True
Set oIE = Nothing
End Sub
Sub LaunchIE_Blank()
Dim oIE As Object
Set oIE = CreateObject("InternetExplorer.Application")
oIE.Visible = True
oIE.Navigate "about:blank"
Set oIE = Nothing
End Sub
Sub LaunchIE_Site()
Dim oIE As Object
Set oIE = CreateObject("InternetExplorer.Application")
oIE.Visible = True
oIE.Navigate "https://www.google.com"
Set oIE = Nothing
End Sub
Sub LaunchIE_File()
Dim oIE As Object
Set oIE = CreateObject("InternetExplorer.Application")
oIE.Visible = True
oIE.Navigate "file://C:\Dev\slider.html"
Set oIE = Nothing
End Sub
or better yet
Sub LaunchIE(ByVal sURL As String)
Dim oIE As Object
Set oIE = CreateObject("InternetExplorer.Application")
oIE.Visible = True
oIE.Navigate sURL
Set oIE = Nothing
End Sub
So, we could call it directly from within our applications!
PowerShell
Since VBScript is being deprecated, I thought it wise to provide a PowerShell solution.
New-Object -COMObject InternetExplorer.Application -Property @{Visible=$true}
New-Object -COMObject InternetExplorer.Application -Property @{Navigate2='about:blank'; Visible=$true}
New-Object -COMObject InternetExplorer.Application -Property @{Navigate2='https://www.google.com'; Visible=$true}
New-Object -COMObject InternetExplorer.Application -Property @{Navigate2='C:\Dev\slider.html'; Visible=$true}
or my preferred approach, similar to what I’d do in VBScript/VBA
$oIE = New-Object -COM "InternetExplorer.Application"; $oIE.visible=$true;
$oIE = New-Object -COM "InternetExplorer.Application;"
$oIE.visible=$true;
$oIE.Navigate2("about:blank");
$oIE = New-Object -COM "InternetExplorer.Application";
$oIE.visible=$true;
$oIE.Navigate2("https://www.google.com");
$oIE = New-Object -COM "InternetExplorer.Application";
$oIE.visible=$true;
$oIE.Navigate2("file://C:\Dev\slider.html");
So yes, we do have a few possible workarounds, for now, but I truly wouldn’t be surprised if these stop working some time down the road!!! Also, notice how all the workarounds involve coding!
Where’s The Access Dev Team On This??
I couldn’t say!
They know full well that they have a product that fundamentally uses IE and they should have ensured we could properly work with it which also mean develop and test with IE. Either they haven’t spoken up on the matter to protect their developer or were simply ignored by the power that be making these decisions.
What about other team that also have/support a ‘Legacy’ Web Browser control. Once again, I have no clue.
All I know is that Microsoft has made it incredibly difficult to do basic testing while they continue to support IE based Web Browser controls and we have to use Code to manage to do our work. Since they remain fully supported, we shouldn’t need to jump through such hoops!