Search This Blog

Saturday, March 5, 2022

Runtime Error 429 in Using Selenium Basic


5 March 2022 

Selenium Basic can be a very useful tool when one is writing an Excel VBA Macro to "scrape" data from a webpage.  

In the past,  one will have to use "imacros" which is a special paid software for scrapping data in Excel because one cannot often use Excel's built-in "data queries" to extract data from a webpage.  These webpages are usually written using VBScript,  Javascript or other forms of HTML tools.  

Please click the picture for more information


The VBA that is used to extract data from a webpage using the normal tools can run into a lot of problems and often took several processes just to complete a simple task. Selenium Basic, on the other hand,  can cut the Excel macros down to just a few lines for the same kind of work.  For example,  it allows users to copy the whole table & then paste it onto Excel as an Excel table instead of a jpg picture.   It is much more efficient;  also, the VBA macros will run much faster,  limited only by the network.

Error Messages

The only snag about using Selenium Basic is the lack of support documents, especially about how to handle script errors.  This is because Selenium Basic is still in the early stage of development.  One of the errors that come up recently is the Run time error 429 as described by a forumer in the "Stackoverlow" forum:

Click the picture to visit the article

What is Error 429?

Error 429 is a common error occurring when one tries to automate office or other similar works. According to Microsoft,  this error when occurring in Microsoft Office VBA work could be due to the following reasons:

  • There is a mistake in the application;
  • There is a mistake in the system configuration;
  • There is a missing component;
  • There is a damaged component.

Microsoft suggested a few solutions as shown on this page.  The solutions can be summarized in simple terms as follows

1.  Check & verify the office application is working;

2.  Re-register the applications;

3.  Check & add the "CLSID key" to the Registry if there are missing in the Registry;

There are other methods suggested which the readers should read in detail. 

How the Error 429 happened?

It happened when one is trying to use special automation software called "Auto Power-On and Shut Down" to turn on and shut down the PC at a specific time automatically. This software has been used before for Excel macro many times without any hitch.  The Excel VBA macros were also tested to run well on another computer.  on this PC in question,  Windows Excel will startup but it would stall whenever it reached the following VBA script.  

  • driver.Start "Chrome"

The solution

The re-registration of the software "Auto Power-On and Shut down" as advised by Microsoft solved the problem.  One will need to run the following script in DOS-Prompt as an administrator:

  • C:\Program Files (x86)\Auto Power-On and Shut Down\Auto Power-On and Shut Down.EXE /regserver

In the above example,  the software,  "Auto Power-On and Shut Down",  was defaulted to be installed in C:\Program Files (x86)


 


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...