cancel
Showing results for 
Search instead for 
Did you mean: 

Handling Macro Exception

Anonymous
Not applicable
Hi, Q: If there is an excel macro invoked by a BP process, and the macro is not well written with poor exception handling, how to handle such unhandled exceptions through blue prism? For example If I get run time error 1004, I am unable to come out of that stage resulting in killing the blueprism process. Please guide. Regards, Sanjesh
4 REPLIES 4

Neel1
MVP
I am also in same situation. Sometimes if input is not feed in correct format to macro, it is causing a pop up which halts the whole bot.   please suggest how to handle this

Anonymous
Not applicable
Hi Neel, It may be best to handle Excel error conditions within the macro itself rather than Blue Prism. The problem is that by using the VBO 'Run Macro' action you are passing control over to Excel and Blue Prism will wait for it to complete. Via this route, there is no way to pass any failure code back to Blue Prism because Excel has generated the error and is waiting for some interaction (human or robot). The only way you could interact with this is by launching Excel and automating via the Application Modeller route. E.g. launch, attach and to spy elements that are generated. Maybe other ways to perform this is to start a process (e.g. a batch file) that runs excel and the macro. You could then build some logic in your BP process to wait for some excel element; e.g. a success message box, the failure dialogue or a timeout? Regards, Sanjesh

SatishKubal
Level 2
Hi, I am using the below approach.. 1) Handle macro error in macro file using Error Handling (On Error Goto ErrorHandler) and store the captured Error Details in the same macro excel worksheet (.xlsm) file in Cell ""A1"". 2) After Run Macro VBO code is executed in BP, add stage to read the Cell ""A1"" using Get Cell Value action in Excel VBO.   Thanks Satish Kubal

Neel1
MVP
Thanks Guys.. Let me try these Solutions