Search This Blog

Saturday, December 2, 2023

Automation Error when running Selenium VBA on Excel

2 December 2023

Chromedriver for SeleniumBasic was running fine before and returned "Automate Error" when Excel was upgraded.  




This error always happened when Excel started to run this macro statement

              driver.start "chrome", ""

Why?

This error will happen when the .NET Framework 3.5 is missing.   One would need to download and install framework 3.5 which is required by Selenium Chrome Driver.    

What could happen when installing .Net Framework 3.5?

 As .Net Framework 3.5 is pretty old software, it might be possible that Windows 10 might refuse to install .Net Framework 3.5.    When this happened,    one could install .Net Framework using the installation scripts that come together with  "SeleniumBasic-2.0.9.0".

After having run and install "SeleniumBasic-2.0.9.0",   go to  "C:\Users\%username%\AppData\Local\SeleniumBasic\Scripts\"  and run " StartChrome.vbs".  The scripts will the automatically download and install .Net Framework 3.5.

What if the above Won't Work?

The .NET Framework is an integral part of many applications running on Windows and provides common functionality for those applications to run. Normally, before running/installing such applications, 

It might be possible that .NET Frame could have already been installed but deactivated. This is especially true when one upgrades or reinstalls Windows 10 while keeping the personal files.   If this is the case,  one needs only to enable .NET Framework from the Control Panel on the compute as follows:

a) Press “Windows Logo” + “R” keys on the keyboard.
b) Type “appwiz.cpl” in the “Run” command box and press “ENTER”.
c) In the “Programs and Features” window, click on the link “Turn Windows features on or off”.
d) Check if the “.NET Framework 3.5 (includes .NET 2.0 and 3.0)” option is available in it.
e) If yes, then enable it and then click on “OK”.
f) Follow the on-screen instructions to complete the installation and restart the computer, if prompted.



 

 

No comments:

Post a Comment

iPhone and iPad: How to Create a Short Cut in Home Screen to Clear Cache & History

23 November 2024 What are Cache and History? Cache and browser history store information about websites you've visited.  The C ache s to...