Visual Basic Application(VBA) |
---|
1. Enable Developer Tab |
2. Remove Gridlines |
3. Filter Bold Cells |
4. Selenium Basic Installation |
5. Launch Chrome Browser |
Finally, you have decided to do some web automation with VBA language. Very good, you came to right place. I will guide you step by step in this web automation journey.
There are few options that we can use for web automation in VBA. But best is selenium. It’s a very powerful tool and we can find a lot of methods and properties to control any web browser.
First question that should come to your mind that what is selenium. So allow me to answer this question, Selenium is an open-source tool that automates web browsers. And the best part is that, selenium is so friendly, it works with most of the languages like Java, Python, dot net etc..
Selenium Basic is a Selenium based browser automation framework for VB.Net, VBA and VBScript.
If you want to run selenium basic on your system, there are some steps you need to follow :
How to Install the Selenium Basic :
If you want to install selenium basic in your system, you need to download it. Following can be followed to download selenium basic :
I am going to show you how to update your chrome driver.
1. When you open the Chrome browser, you will see three dots on the right side. Choose those three dots, then mouse hover on the ‘Help’ option, and click on ‘About Google chrome’
2. Check your browser’s version
3. Open ‘https://chromedriver.chromium.org/downloads’ website in your browser and click on the chrome driver according to your chrome’s version
4. Click on ‘chromedriver_win32.zip’ and download driver, Now extracts the downloaded zip file and open the extracted folder, you will find a ‘chromedriver.exe’ file, copy the file
5. Go to ‘C:\Users\<<youruser>>\AppData\Local\SeleniumBasic’ folder and paste your driver, a popup will appear, click on ‘Replace the file in the destination’ option
6. Chrome driver has been updated now
Now, you need to check whether you have .net Framework 3.5 installed on your machine or not. To do so, go to the below location
C:\Users\<<youruser>>\AppData\Local\SeleniumBasic
Open the ‘Scripts’ folder
You can find VB Script file for the web driver, double click on ‘StartChrome.vbs’(VB Script) file
If following message box is coming, then you good to go. You don’t need to do anything
When you double clicks on the VBS file and you are getting below popup that means you have to install .Net Framework 3.5 to run selenium code on your machine
1. Click On the ‘OK’ button to close the error pop up
2. Now click on ‘Download and install this feature’ button to install .Net framework 3.5
3. Now wait and let it download the required files and install the .Net Framework 3.5 on your machine. Once the installation got completed, you will get the below screen. Click on the ‘Close’ button to close the popup. The .Net Framework 3.5 has been installed. Now you need to restart your system
4. After restarting your system, you need to again go to the Script folder and run ‘StartChrome.vbs’ file by double clicking on it.
5. You will get the above popup. That means everything is ready now and you can run VBA selenium code.