Skip to main content

Hi Team,

I am using Run macro to run a excel macro which interacts with external application. Some times due to unexpected issues getting an popup in Excel either to debug or End which causing Bot to struck at Run Macro command untill we manually click on End. Please help to handle this in the code

Are you able to modify the macro?

If so, you could surround your code with an error-handling routine.

You can find more info in the following links:

On Error statement (VBA) | Microsoft Learn

VBA Excel simple Error Handling - Stack Overflow

 

You could also extract the macro’s code, but this might not be ideal depending on your particular situation. 

Essentially, VBA is a language that connects to the Excel object library. PowerShell is also a language that can connect to Excel object library. Still others including JavaC#PythonPHPR, and more have this facility via Component Object Model (COM) available in Windows environments.

excel - How to use VBA Code inside a Powershell Script - Stack Overflow


Reply