The notification “The VBA project is not digitally signed” appears when Excel’s Trust Center is set to block unsigned macros, and the workbook lacks a valid cryptographic certificate. When this policy is active, Excel blocks all macros in the file from executing to protect the system from untrusted code.
Quick Answer
Generate a personal code certificate using
SelfCert.exe(located in your Microsoft Office program files). Open your workbook, pressAlt + F11, click Tools > Digital Signature, select Choose, pick your certificate, and save the workbook as.xlsm. For distributed files across a network, use a certificate issued by an internal corporate Certificate Authority (CA).
Why Excel Requires Digital Signatures
Modern macro security blocks malicious code from executing automatically. The Trust Center evaluates macro files based on four tiers:
- Trusted Locations: Folders designated as safe bypass signing rules entirely.
- Signed by a Trusted Publisher: Files signed with a recognized certificate run without warnings.
- Unsigned / Untrusted: Files are blocked or prompt a yellow or red security bar.
When a company’s Group Policy (GPO) sets macro execution to “Disable all macros except digitally signed macros”, Excel inspects the file’s digital signature block before loading the VBA project. If no certificate exists or the signature has been invalidated, execution is blocked immediately.
Step-by-Step Fix: Creating and Applying a Digital Signature
Method 1: Self-Signed Certificate (Local Machine Only)
If you are the only user of the workbook, use Microsoft Office’s built-in SelfCert utility:
- Close Excel.
- Open Windows File Explorer and navigate to your Office installation folder (typically
C:\Program Files\Microsoft Office\root\Office16\orC:\Program Files (x86)\Microsoft Office\root\Office16\). - Locate and launch
SelfCert.exe. - In the dialog, type an identifiable name in the Your certificate’s name field (e.g.,
DevCert_YourName) and click OK. - Re-open your macro workbook in Excel.
- Press
Alt + F11to launch the Visual Basic Editor. - Click Tools > Digital Signature… from the top menu.
- Click Choose…, select your newly generated certificate from the list, and click OK.
- Click OK to close the Digital Signature dialog.
- Save the workbook (
Ctrl + S).
Digital Signature Process via SelfCert.exe
│
1. Run SelfCert.exe in Office directory
│
2. Enter name -> Generate personal cert
│
3. Open VBE (Alt + F11) -> Tools -> Digital Signature
│
4. Click Choose -> Attach Certificate -> Save (.xlsm)
Important Limitation: A self-signed certificate is valid only on the computer that generated it. If you email this file to a colleague, their system will flag the certificate as an “Untrusted Root Authority” and continue blocking the macro.
Method 2: Enterprise or Public Certificates (Multi-User Workbooks)
For workbooks shared across teams or departments:
- Request a Code Signing Certificate from your organization’s IT department or Public Key Infrastructure (PKI).
- Install the provided
.pfxor.cerfile into your local Windows certificate store under Personal > Certificates. - Confirm that your organization has deployed the issuing CA certificate into the domain’s Trusted Root Certification Authorities store.
- Attach the certificate in the VBA editor via Tools > Digital Signature.
What to Do If the Signature Breaks After Saving
A digital signature is a cryptographic hash of the VBA code. Any change to the project invalidates the existing signature. Follow this diagnostic checklist if the signature warning persists:
Check 1: Code Edits Invalidating the Signature
If any code line, module comment, or form property changes, the existing signature is revoked immediately.
- The Diagnostic: Re-sign the project via Tools > Digital Signature every time you modify code or update sheet modules. Save the file immediately after re-signing.
Check 2: Certificate Corruption in Saved Files
Workbooks saved across unstable cloud shares or converted between legacy formats can experience corrupted signature blocks.
- The Diagnostic: If Excel reports corruption after signing, see Troubleshooting “Digital Signature” corruption in Macro-Enabled workbooks. If the file itself fails to open cleanly, reference Fixing “Excel found unreadable content” in .xlsm files.
Check 3: Certificate Expiration
Code-signing certificates typically expire after one to three years.
- The Diagnostic: Open
certmgr.mscin Windows, double-click your certificate, and check the Valid to date. If expired, you must renew or regenerate the certificate and apply it to the workbook again.
Alternative Solutions for Internal Tools
If obtaining an enterprise code-signing certificate is not feasible, consider using an authorized Trusted Location instead of signing individual files:
- Place the workbook into a directory whitelisted in File > Options > Trust Center > Trust Center Settings > Trusted Locations.
- Trusted Locations allow macros to run without security warnings, regardless of their signature status. Review “Macros have been disabled”: Troubleshooting the “Trusted Locations” security block for configuration details.
If your signed macro still refuses to launch after clearing security warnings, confirm that the macro is not suffering from a broken procedure assignment using Fixing “Cannot run the macro… The macro may not be available in this workbook.”.