EDGE : Opening and filling a webpage through VBA

Mohtadi 41 Reputation points
2022-05-10T08:09:09.727+00:00

Hello ,

As IE is decommissionned , we are trying to migrate to EDGE / Chrome or any other viable alternative...

many VBA macros in my organization , depend on IE to open websites and fill some information automatically...

We are trying to switch these macros to open EDGE instead ( basically , replace the CreateObject ( IE ) ) , with another alternative....

Macros ,are as well , filling and parsing websites...

I would like to know , what is the plan for this please?

Microsoft Edge
Microsoft Edge
A Microsoft cross-platform web browser that provides privacy, learning, and accessibility tools.
2,125 questions
0 comments No comments
{count} votes

Accepted answer
  1. Yu Zhou-MSFT 12,056 Reputation points Microsoft Vendor
    2022-05-11T01:53:37.943+00:00

    Hi @Mohtadi

    If you want to automate Edge through VBA, you need to use SeleniumBasic. SeleniumBasic is a Selenium based browser automation framework for VB.Net, VBA and VBScript.

    You can follow the steps below to automate Edge browser with SeleniumBasic:

    1. Download the latest version of SeleniumBasic v2.0.9.0 from this link and install it.
    2. Download the corresponding version of Edge WebDriver from this link.
    3. Find the path of SeleniumBasic which is C:\Users\%username%\AppData\Local\SeleniumBasic in my situation (it might also be in this path C:\Program Files\SeleniumBasic), copy the Edge WebDriver msedgedriver.exe to this path.
    4. Rename msedgedriver.exe to edgedriver.exe.
    5. Open Excel and prepare to write the VBA code.
    6. In the VBA code interface, click Tools > References, add Selenium Type Library reference and click OK to save.
    7. Example VBA code (you can change it according to your demands): Public Sub Selenium()
      Dim bot As New WebDriver
      bot.Start "edge", "https://www.google.com"
      bot.Get "/"
      bot.Wait 5000
      bot.Quit
      End Sub

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Regards,
    Yu Zhou

    2 people found this answer helpful.

3 additional answers

Sort by: Most helpful
  1. Victor Faria 6 Reputation points
    2022-10-19T22:15:34.203+00:00

    Hello Everyone

    It seems the solution is selenium, but there are a lot of work to be done to convert and test all the code.
    • Selenium still as a long way to go to replace internet controls in IE
    • So far it’s been a battle to get it to even start a browser, its bugs after bugs.

    In the meantime, somebody in Denmark seems to have a temporary solution, which allows macros to continue to run until all code is converted to selenium.
    https://pomio.dk/internet-controls-for-edge/
    In this website he uses a VBA library “Internet controls for edge” and automates edge with the same VBA code.
    The issue is that the library is not available anywhere.

    Is “Internet controls for edge” an actual VBA library?

    1 person found this answer helpful.

  2. vin gasoline 1 Reputation point
    2022-05-11T21:00:28.897+00:00

    refer to a comment by KelvinYeung-7479 here https://learn.microsoft.com/en-us/answers/questions/829365/vba-automation-with-edge-ie-mode.html

    it is possible to have Edge do some data input for you with the IE mode on, but I don't think you can execute the "on click", etc. events thru that code. At least I wasn't able to.

    0 comments No comments

  3. Wafa Habchi 1 Reputation point
    2022-05-14T07:12:46.757+00:00

    Good answer

    0 comments No comments