VBA Selenium

In this tutorial, you will know:

  1. With VBA coder, how can you start with Selenium ?

I will continue to update …

1. HOW TO USE VBA TO DEAL WITH SELENIUM

Step 1:

  • First of all, you must have Selenium Basic installed on your computer in order to using reference “Selenium Type Library” as image below –> Click here to download Selenium Basic (with latest version).

After you downloaded, click on SeleniumBasic-2.0.9.0.exe to install:

Step 2:

Because Selenium Basic is released from 2016, so, up to now something will be out of date, among of that is chromedriver. Hence, you must download chromedriver (latest version) and replace of the one in Selenium Basic folder.

Step 3:

Ok, now you can open VBA, add reference Selenium Type Library and use Selenium to control Chrome, IE, Firefox:

Example 1: Let start with example below:

Public Sub Untitled_2()
Dim selenium As New selenium.WebDriver
selenium.Start “chrome”, “https://indexes.nasdaqomx.com/Account/LogOn”
selenium.Get “/”
‘selenium.Close
End Sub

By ThanhVL

Leave a Reply