Will Excel VBA calls to Internet Explorer work in Windows 11?
I read that support for IE-11 ceases in Windows 11. I have report-creation code in some Excel VBA projects that call the objIE object (which opens IE). Will those still work, or do I need to revise code?
Once I have created the necessary text in sHTML, THIS is called. What is likely to happen in Windows 11?
Private Sub showReport()
Dim objIE As Object
Dim i As Long
Err.Clear
sReportPath = CreateFolder(ActiveWorkbook.Path, "Reports")
On Error GoTo Error_Handler
Set objIE = CreateObject("InternetExplorer.Application")
With objIE
.navigate "about:blank"
Do While .Busy: DoEvents: Loop
Do While .ReadyState <> READYSTATE_COMPLETE: DoEvents: Loop
.Document.Write sHTML
On Error Resume Next
If (tRptOpt And RptOptPreview) Then
.Visible = True
End If
End With
Set objIE = Nothing
sReportFilename = vbNullString
Exit Sub
End Sub
Solution 1:
Internet Explorer is mostly gone in Windows 10 (> 95%) and completely gone in Windows 11 (two Windows 11 Pro machines here).
So you need to re-write the code to use Chromium Edge and eliminate all dependence on IE.
Here is a reasonable support article.
IE 11 gone from Windows 11
Microsoft revealed yesterday that Internet Explorer will be “disabled” in Windows 11. At first, I was worried that it meant Internet Explorer might hang around ahead of the final nail in its coffin on June 15th, 2022, but it’s actually fully disappearing from Windows 11. “The Internet Explorer 11 desktop application will not be available on Windows 11. Microsoft Edge is the default browser for Windows 11,” explains a Microsoft spokesperson to The Verge. “The MSHTML engine exists as part of the Windows 11 operating system to power IE mode in Microsoft Edge.”
As the article notes, Chromium Edge will support most of the IE 11 requirements, but still best that you re-work your VBA to fully accommodate Edge.