Blue Prism Product

 View Only
last person joined: 12 hours ago 

This community covers the core Blue Prism RPA product.

 How to disable Excel Macro in BP

KW Liu's profile image
KW Liu posted 11-22-2022 03:57
Hi all

I'm trying to write a value to a worksheet cell using the BP Excel VBO object 's "Set Cell Value" action.  However, a preset selection menu will popup automatically causing the process hangs.

I tried to disable the Excel Macro from the Options > Trust Center and the it still doesn't work.

Can anyone advise how the Excel macro can be disabled thru BP ?

Many thanks.

Regards,
G. Liu
RPA developer
---------------------
Ronny Gruhl's profile image
Ronny Gruhl
1. You can change general macro settings in the Trust Center (M365). Choose Disable all macros without notification

2. You can save the file as ".xls " or ".xlsx" before with the Excel VBO "Save Workbook as". To force the format of the file, you can create a new page "Save Workbook as .xlsx" with this code stage:

Dim wb as Object = GetWorkbook(handle,workbookname)
Dim excel as Object = wb.Application

excel.DisplayAlerts = False
wb.SaveAs (filename, 51)
excel.DisplayAlerts = True

newworkbookname = wb.Name
KW Liu's profile image
KW Liu
Hi Ronny

Thanks for the advice.  However, I have finally come up with an easier solution.
I created a collection with 2 fields. The 2nd field contains the value to be written to the cell with preset selection menu.  I then use the normal write to cell function from BP which starts writing the collection to the cell on the left. And it did write 2 values in 2 cells and no more popup menu !

And of course, I have disabled all the macros from the Excel Trust Center.

Many Thanks.