Search code examples
excelvbacertificate

Signed Macros Are Disabled In Excel


I have two Excel files:

  1. A newly created, empty Excel file with 1 macro in it
  2. A large Excel Model containing macros, custom formats, range names, tables, custom ribbon UI, etc.

I have digitally signed the macros in each file and set Excel Macro Settings to "Disable all macros except digitally signed macros".

When opening the freshly created file the macros run fine. When I open the large file the macros are disabled.

I have ensured that they are both signed with the same certificate and saved correctly.


Solution

  • After a lot of process of elimination we narrowed the issue down to a single range name with RefersTo: TRANSPOSE(GET.WORKBOOK(1))&T(NOW())

    If the above range reference exists inside a XLSM file with digitally signed macros, then Excel will silently disable the macros even though it was signed by a trusted certificate.