excelxll

Can I run Excel from a .cmd script with all macros enabled?


How can I run excel from command line / cmd script such that it doesn't prompt if I want to enable macros in the spreadsheet I am running it with?


Solution

  • Signing your macros with a digital signature may do what you want. If you've signed the macros in a spreadsheet, then a user who opens it is prompted:

    "Foo.xls" contains macros by Acme Software, Inc. Macros may contain viruses. It is usually safe to disable macros, but if the macros are legitimate, you might lose some functionality.

    The user will get the usual Disable / Enable Macros choice, but she will also get a bonus option:

    Always trust macros from this publisher.

    If the user selects that option, she will never see the prompt again for this file or any other signed by the same publisher.