Visual Basic Application(VBA) |
---|
1. Enable Developer Tab |
2. Remove Gridlines |
3. Filter Bold Cells |
4. Selenium Basic Installation |
5. Launch Chrome Browser |
The first step in using Selenium Basic to launch a browser is to add the "Selenium Type Library" to your VBA Project. The steps for adding the "Selenium Type Library" are as follows.
It is now time to code. To properly clarify the steps, we have incorporated comments for each block of code.
'In order to prevent Chrome from closing once the macro is executed, 'a variable of type ChromeDriver must be declared outside of the subroutine. Private Driver As Selenium.ChromeDriver Sub OpenAutomationFeverWebsite() 'Create instance of the ChromeDriver Set Driver = New Selenium.ChromeDriver 'Launch the chrome browser Driver.Start 'Navigate to automationfever.com Driver.Get "https://www.automationfever.com/" 'Maximize the browser window Driver.Window.Maximize End Sub
VB Editor Window will look like below:
When you run the code, it will open the Chrome browser and go to www.automationfever.com. The screenshot of the Chrome is shown below.