Invoke VBA Macro (Macros disabled)

I am trying to develop a bot for my organization that invokes an Excel VBA macro stored in a txt file. Unfortunately, the default settings on my organization’s computers is for macros to be disabled in the trust center settings within excel.

I have tried using the invoke macro activity but have not had any success. I assume it is because of the security settings. Is there any way to work around this?

Is there a way to use UIPath to enable macros on an active workbook? Additionally, I would like the macro to run on workbooks that are xlsx and xlsb files.

Is any of this feasible?

Hi
Welcome to uipath community
Did we try with INVOKE VBA activity or did you mean the same didn’t work

Cheers @ryanstratford

Yes apologies - that is what I meant. The INVOKE VBA activity.

Fine
If so may i know the error you were getting
@ryanstratford

Here are my organization’s trust settings:

Hi @ryanstratford,

Welcome to the Uipath Community!

I don’t think there’s another way but to create a workflow that if you get the error the open excel and disable it using clicks and that stuff. Just a simple task. It’s not that hard, give it a try. :smile:

Ohhh but it’s disabled. That’s another thing. You will have to talk with the administrators to enable the access.

May I know the filepath mentioned the excel application scope
@ryanstratford

I allow the user to select the excel file. For now, I have defined the file path for the text file containing the VBA I want to invoke.

No buddy
I would like to know the value of the excelBook variable mentioned in EXCEL APPLICATION SCOPE
@ryanstratford

Is that file having extension as xlsm (macro enabled)
If so try using either xlsx or xls file alone and then run this
Process

Let’s try that once
@ryanstratford

That may have worked. I was running it on xlsb before - not sure why that didn’t work. I have run macros on xlsb files before.