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:
- Download the latest version of SeleniumBasic v2.0.9.0 from this link and install it.
- Download the corresponding version of Edge WebDriver from this link.
- Find the path of SeleniumBasic which is
C:\Users\%username%\AppData\Local\SeleniumBasic
in my situation (it might also be in this pathC:\Program Files\SeleniumBasic
), copy the Edge WebDrivermsedgedriver.exe
to this path. - Rename
msedgedriver.exe
toedgedriver.exe
. - Open Excel and prepare to write the VBA code.
- In the VBA code interface, click Tools > References, add Selenium Type Library reference and click OK to save.
- 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