I am trying to run excel macro using VBS and getting attached error. Is there a way to enable macro at the run time? if so, how?
1 Answer
This should be done in Excel itself:
- Click the File tab and then click Options.
- Click the Trust Center tab and then click the Trust Center Settings button.
- Click "Enable all macros" Note - it is not recommended for a reason to do so!
- Set the checkbox to "Trust access to the VBA project object model"
2 Comments
L42
I stand corrected,
DisplayAlerts set to False my not be able to kill the pop-up. Although it worked for me even on network files. I however checked my Trusted Document and Trusted Location list and most (not all) of the files I execute macro from are there. But then again, I have distributed VBS file to many different users and it works just by using the DisplayAlerts = False. Anyhow, if the OP confirms it does not help, I'll delete it for now. Cheers! :)Vityata
@L42 - yup, the checkbox is important.

