1

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?

enter image description here

1
  • Right click file - Properties - Unblock. Commented Feb 13, 2018 at 9:52

1 Answer 1

2

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"

enter image description here

Sign up to request clarification or add additional context in comments.

2 Comments

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! :)
@L42 - yup, the checkbox is important.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.