cancel
Showing results for 
Search instead for 
Did you mean: 

Call Macro VBA (Excel)

Anonymous
Not applicable
Hello! DO you know how to call a vba macro after opening the spreadsheet?
9 REPLIES 9

Denis__Dennehy
Level 15
I think the MS Excel VBO object has a run macro action. I have also had to create an interface to the run macro button on the Excel developer tab before because of a threading issue with the dialog that the Excel button opened.

NitinSafaya
Level 3
Store the macro in Personal.xlsb. You can check out this URL for storing macro is a single workbook: https://support.office.com/en-us/article/Create-and-save-all-your-macro… Now you ll have Personal.xlsb file containing the macro and the excel file on which you want to run the macro. 1. Copy the Personal.xlsb file to My Documents folder. You can Hide or Unhide Personal.xlsb in View->Unhide/Hide 2. Open the file on which you want to run the macro and get the handle number in variable. Then use MS Excel VBO and Input Macro name as Personal!. and provide the handle number.

GeJiang
Level 3
Hi Nitin, Thanks for your explanation. I followed your process but I got the error message saying ""Cannot run the macro 'Personal!.'.The macro may not be available in this workbook or all macros may be disabled."" However, the macro is in this place for sure. Do you know why I have this message? Do I need to do something in Excel to ""enable Macro"" before Blue Prism could call it? Thanks a lot!  

VijayDodamani1
Level 2
By Creating personal.xlsb macro file, it'll open with each and every excel file which you open. So inside the personal.xlsb file if you're dealing with any code try to write code with ActiveSheet.. Here ActiveSheet will refer to current opened workbook's sheet. Steps to create and run Macros using BP: 1. Create a personal.xlsb file it will store (By default) copy that file and paste at ...... location which BP access will be there. 2. Open an excel --> go to File --> select Option --> select Trust Center --> Open Trust Center Setting --> Go to Trusted Location --> Add path of .xlsb file 3. Then we can directly use the Macro in Excel using BP by passing parameter  NOTE: If step number 2 is skipped, you'll get The macro may not be available in this workbook or all macros may be disabled this message.This is one time setting.  

RamakrishnaVinn
Level 2
Hello !  MS Excel VBO dont have ""Run Macro"" option , Please help where to check.

guna_vardhanmee
Level 3
check the image below

RamakrishnaVinn
Level 2
MS Excel VBO that i have does not having Run Macro action at all , Is there a place where i can down load latest MS Excel VBO with Run Macro available 

guna_vardhanmee
Level 3
You can download it from portal it has al updated VBO's

Anonymous
Not applicable
Save the Macro Function in a Module, not in the worksheet. Otherwise you will get an error.