cancel
Showing results for 
Search instead for 
Did you mean: 

Enable Content for Macros in Excel

DenisEischen
Level 3
Hello! I am currently trying to run a process that opens up an excel file, inputs a few numbers, then runs a macro. I am having an issue with running the macro, because whenever I open the instance my macros are disabled. I wanted to know if there is a way to enable macros upon opening the workbook without actually spying for the "enable content" button. So far I've tried setting the "Enable Events" flag in my create excel instance to "True" which didn't seem to work. Then I created a "set events enabled" action between the "create instance" and "open work book" actions and I set that flag to "True". That did not work either. Any help would be greatly appreciated!   Thank you!
3 REPLIES 3

MichalSzumski
Level 6
Hi Denis,   We had the same issue and solved it by changing Excel settings to allow macros - see attachments.   Best regards Michal

DenisEischen
Level 3
Michal,   Thank you for your response, unfortunately our organization does not give us permission to enable that setting as the default. The only way we can enable macros is manually clicking ""enable content"". I'm starting to think the only way around it is to spy the button and press it using application modeller. If anyone else has any suggestions I'm all ears!   Thanks, Denis

VijayDodamani
Level 5
Hello Denis,   Please don't change the setting for macro to enable all macro - as even they have mentioned the risk over. An alternative solution for that is, add you macro file location under trusted location, so the excel application will open and execute macro without any issue as it will be treated as trusted file.   Thanks & Regards, Vijay Rudrappa Dodamani