Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Switching from Internet Explorer to Microsoft Edge

After the recent release of Windows 10, including the new browser - Microsoft Edge - would anyone simply know how to open Microsoft Edge browser via Excel VBA. I have tried searching the website without any luck.

This is the current basic Excel VBA coding I use to open the Internet Explorer:

Sub xyz()

Dim Browser As SHDocVw.InternetExplorer 'Microsoft Internet Controls
Dim HTMLdoc As MSHTML.HTMLDocument 'Microsoft HTML Object Library
Dim URL As String

  URL = "http://www.bbc.co.uk/news"
  Set Browser = New InternetExplorer
    Browser.Silent = True
    Browser.navigate URL
    Browser.Visible = True
  Do
    Loop Until Browser.readyState = READYSTATE_COMPLETE

    Set HTMLdoc = Browser.document

End Sub

This is a very straight forward piece of VBA coding to open the BBC website for example.

However, what is the new piece of coding to open Microsoft Edge?

like image 949
Charlie Avatar asked Aug 03 '15 09:08

Charlie


2 Answers

According to MS here, IE11 ships with Windows 10

The default browser for Windows 10 is Microsoft Edge, which is powered by our new rendering engine and is our path forward for the Web on Windows. Site developers should focus their testing on Microsoft Edge for new and existing experiences. Internet Explorer 11 will be included for some legacy scenarios and users will be have the option to choose it as the default browser, like with any other browser.

So existing code for IE should continue to work. Not tried it though.

Some technical stuff on Edge can be found here

As of Mon 10-Aug-2015, I have upgraded one PC from Win 7 Pro SP1 to Win 10 Pro and the code you supplied works fine. IE11 runs fine and shows the website. The IE11 download page confirms that I've already got it installed.

like image 173
ChipsLetten Avatar answered Nov 01 '22 17:11

ChipsLetten


I had a similar issue upon updating to Windows 10. Turns out 'Microsoft Internet Controls' and 'Microsoft HTML Object Library' had been "removed" from 'References'. Adding them resolved the problem and code worked fine without requiring any alterations. Don't know if this helps.

like image 1
user5378755 Avatar answered Nov 01 '22 17:11

user5378755