Digitally Signing Excel Macro Project Using Code Signing
Introduction
Macros in Microsoft Excel are powerful tools that can do complicated tasks automatically. Excel often turns off or warns about unsigned macros because they can be dangerous, especially in business settings. You need to digitally sign your Excel macro project with a code signing certificate to get around these problems and make sure that your macro code is safe.
In this guide, we'll show you how to digitally sign your Excel macros from start to finish. We'll explain what it is, why it's important, and how to do it safely.
About code signing and why is it important for Excel macros?
Signing code means putting a digital signature on software or scripts to prove who wrote them and make sure that the code hasn't been changed since it was signed. In the world of Excel macros, code signing means:
- Checks to see who made the macro.
- Stops people from messing with the macro.
- Gets rid of or lowers security warnings in Excel.
- Lets the macro run in places where macro security settings are very strict.
If you don't sign your code, your macros might be blocked or raise red flags, especially on corporate networks or systems with antivirus software.
Things you need to do before you can digitally sign Excel macros
- Code Signing Certificate: A valid Organization Validation (OV) or Extended Validation (EV) certificate from a trusted Certificate Authority (CA) like DigiCert, Sectigo, or SSL.com.
- Excel installed with the Developer tab enabled.
- Certificate Installed: The certificate should be in the Windows Personal Certificate Store.
- (Optional for Testing) Use Microsoft's SelfCert to make a self-signed certificate for development purposes only.
Step-by-Step: How to Digitally Sign Your Excel Macro Project
Step 1: Open the Excel file that has your macro or VBA project in it
- Open the Excel file with your macros.
- Enable the Developer tab via File > Options > Customize Ribbon and check Developer.
- Press Alt + F11 to open the VBA Editor.
Step 2: Open the VBA Project
- In the Project Explorer, locate your macro project.
- Ensure your code is complete and tested before signing.
Step 3: Pick the Certificate for Code Signing
- In the VBA Editor, go to Tools > Digital Signature.
- Click Choose in the Digital Signature window.
- Select your installed code signing certificate.
- Click OK to confirm.
Step 4: Keep the File with the Signed Macro
- Save the file as .xlsm or .xlsb.
- Make a backup before signing, in case you need changes later.
Step 5: Checking the Digital Signature
- Reopen the signed Excel file.
- Go to File > Info > View Signatures to verify.
- Test opening the file on another computer to confirm no warnings appear.
Taking care of certificate expirations and renewals
- Most certificates last 1–2 years.
- If you time-stamp the file, macros will still run after expiry.
- Always add a timestamp when signing.
- Re-sign with a new certificate after renewal.
Fixing common problems
- Certificate Not Visible: Ensure it’s in the personal store of the current user.
- Security Warning Still Shows: Set Excel’s macro settings to trust the publisher.
- Signature Lost After Edits: Re-sign after modifying macro code.
- "Not to be trusted" Error: Ensure the certificate is from a trusted CA and not expired.
How to Sign Excel Macro Code the Right Way
- Use EV Certificates for better trust in business settings.
- Always include a date on the signature.
- Sign only final macro versions.
- Use version control to track changes and signatures.
- Inform your IT/security team when deploying signed macros company-wide.
To sum up
Digitally signing Excel macros not only makes them more trustworthy and secure, but also ensures easy deployment—especially in businesses. With growing concerns over macro-based threats, code signing is now a necessity.
If you're a VBA developer or part of an IT team, this guide will help you sign Excel projects properly, avoid unnecessary security warnings, and maintain professionalism in your code.
FIPS-140 Level 2 USB or Existing HSM
Stored on an External Physical Device
3 to 5 Business Days