logo
search
VBA & Macro Problems

Fix Excel Discarding Digital Signatures After Saving XLSM Files

John WilsonJohn Wilson Oct 1, 2026 869 views

Question details

Users experience Excel dropping or discarding digital signatures in XLSM workbooks upon saving, prompted by unintended modifications to the VBA project or UserForms.

How to Fix Excel Discarding Digital Signatures After Saving XLSM Files
Product
Microsoft Excel
Device & OS
not provided
Scenario
Saving a digitally signed XLSM workbook that contains VBA macros, controls, or UserForms.
Observed behavior
Excel displays a warning that the signed VBA project was modified and discards the digital signature upon saving the file.
Before you start

Verify that your digital certificate is still valid and properly installed in your system's certificate manager before debugging VBA triggers.

Solution 1Recommended

Identify and Isolate Unintended VBA Modifications

Determine which action, event, or UserForm property is triggering the modification flag on your VBA project and causing the signature to be discarded.

Any unexpected change to VBA project content, UserForms, controls, or workbook state can invalidate a digital signature. Testing these triggers individually helps pinpoint the exact cause.

1
Use breakpoints for testing

Open the VBA editor (Alt + F11) and set breakpoints in your Workbook_Open or Auto_Open event handlers to step through the code and catch any line that alters the project state.

2
Review UserForm properties

Check if opening the workbook automatically modifies UserForm controls, captions, or dimensions, as dynamic property changes will flag the project as modified.

3
Test suspected actions individually

Perform actions one by one, such as viewing a UserForm or running a specific calculation, and manually save the file after each step to isolate the exact trigger.

4
Re-sign the workbook

Once the unstable code or property is identified and fixed, navigate to Tools > Digital Signature in the VBA Editor and re-apply your certificate.

Identify and Isolate Unintended VBA Modifications
Editor Trigger Warning: Simply opening and viewing a UserForm in the VBA Editor can sometimes recalculate dimensions and flag the project as modified in Excel.
Free Microsoft Office alternative

Try WPS Office for a Seamless Spreadsheet Experience

If complex VBA errors and digital signature conflicts in Microsoft Excel interrupt your workflow, consider switching to WPS Office. It provides a lightweight, highly compatible spreadsheet editor that makes managing your data straightforward and efficient.

  1. 1. Download and Install: Visit the official WPS website to download WPS Office and follow the straightforward installation prompts.
  2. 2. Open Your Spreadsheet: Launch WPS Spreadsheet, go to Menu > Open, and select your Excel file to begin editing instantly.
  3. 3. Edit and Save Seamlessly: Manage your data using familiar tools and save your progress without navigating complex signature validation errors.
Highly compatible with Microsoft Excel formats including .xlsx, .xlsm, and .csv.Lightweight architecture ensures fast loading and smooth performance on older devices.Familiar, tabbed user interface minimizes the learning curve for Excel users.Free to download and use for all your essential spreadsheet tasks.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my digital signature disappear when I save my XLSM file?

A digital signature is designed to verify that the file hasn't been altered. If a macro, user action, or even opening a UserForm in the VBA editor changes the underlying project data, Excel considers the file modified and automatically discards the signature for security reasons.

Can I prevent the VBA editor from modifying my UserForms automatically?

Sometimes Excel recalculates or adjusts UserForm properties upon opening based on system display settings. To minimize this, ensure your code doesn't initialize visual properties dynamically upon opening, and fully compile the VBA project (Debug > Compile VBAProject) before saving and applying the final signature.

How do I re-add a digital signature to my VBA project?

Open the VBA editor by pressing Alt + F11, click on 'Tools' in the top menu bar, select 'Digital Signature', click 'Choose', and select a valid digital certificate from your system to re-sign the project.