cancel
Showing results for 
Search instead for 
Did you mean: 

Excel Macro not working

Hello all!

I've started working with BluePrism RPA recently, and I'm facing an issue working with a Macro on Excel. I have created my object and when I try to test it, I've got the following error:

emiliodelbarrio_0-1714129633155.png

The macro is public, I've enabled macros and try to include it in the macro code too, but still not working.

I've tried everything but I'm still unable to make it run.

Could you help me, please?

Best regards.

 

5 REPLIES 5

Daniel_Sanhueza
Level 8

Hello @emilio.delbarrio I think I can give you some hints and tips when working with macros, 

Are you able to run the macro locally on the excel file? If not, perhaps the problems lies on the excel not being properly configure to use macros. 

If you use "Run Macro" action and the macro throws an error (such as the one you posted) It will "hang" blueprism because it'll be waiting for the macro to end, when you click on "end" button the process will be no more on "waiting" status. Similar behaviour is found when the macro displays a popup that require an interaction with inputs or buttons. 

in those scenarios, you could write your own code on a code stage in blue prism (If the macro throws an error and a popup is displayed, it will hang, so make sure to use a trycatch to bubble up an exception on blueprism).

The one that I usually use and it is faster an reliable is automate the excel and use the macro, automating as any other platform that normally we do. When the macro is completed, then I use Ms excel vbo to do whatever is needed. Not as fancy as coding but imagine if the code needs to be updated and the guy who wrote that code is no more on the team and none of us knows how to code? it is painfull to even try to understand it.

Hope it helps.. in some way 🙂

 

Daniel Sanhueza
RPA Professional Developer
Deloitte

sumire
Level 8

Hello @emilio.delbarrio ,

My Excel is the Japanese version, so the screen shots are in Japanese.
So I know it is difficult to understand for other language, but the order of the menu should be the same.

First, as @Daniel_Sanhueza said, open the Excel file and see if you can manually run the macro correctly. Assuming you are able to do that,

  • In Excel settings, in the "Trust Center", turn on the "Trust" check box for "Macro Settings for Developers" in the screen shown in the figure below:

sumire_0-1714274019820.png

  • Older versions of Excel files (with ".xls" extension) will show this error even if macro settings are enabled. In that case, please re-save it with the extension ".xlsm" and use it.

 

------------------------------
Mitsuko
Asia/Tokyo
------------------------------

Hello @Daniel_Sanhueza , @sumire 

First of all, than you very much for both replies.

I have enabled macro settings and macro can be run locally without a problem, but problem is whenever I try to run it on BluePrism.

This macro has additional add-ins, maybe is something related to Excel not opening that add-ins? Is there a way to open Excel by default with that add-ins?

Thank you again for your time!

Try open the excel with "Utility - Environment:Start process" give "EXCEL" as is process input and the filepath on the argument, then use "Utility - Environment:Wait for process window" until is fully displayed. Next, attach to the instance with the object MS Excel VBO and run the macro. I use that approach when the excel is too heavy and Open Workbook cant open the excel if it took more than 60 second if I remember correctly, perhaps this works for you.

regards

Daniel Sanhueza
RPA Professional Developer
Deloitte

sumire
Level 8

Hello @emilio.delbarrio ,

Try "Run Macro from Text File" or "Run Macro with Parallel Thread" in new ver of "MS Excel VBO".
You can specify Timeout second, and If you want to try it out, you can also separate the macro from the Excel file and see how it works.

------------------------------
Mitsuko
Asia/Tokyo
------------------------------