Fix Excel Discarding Digital Signatures After Saving XLSM Files
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.

- 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.
Verify that your digital certificate is still valid and properly installed in your system's certificate manager before debugging VBA triggers.
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.
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.
Check if opening the workbook automatically modifies UserForm controls, captions, or dimensions, as dynamic property changes will flag the project as modified.
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.
Once the unstable code or property is identified and fixed, navigate to Tools > Digital Signature in the VBA Editor and re-apply your certificate.

Review Excel Macro and Signature Trust Settings
Ensure that Excel's Trust Center settings are properly configured to handle macros and trusted publishers for XLSM files.
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. Download and Install: Visit the official WPS website to download WPS Office and follow the straightforward installation prompts.
- 2. Open Your Spreadsheet: Launch WPS Spreadsheet, go to Menu > Open, and select your Excel file to begin editing instantly.
- 3. Edit and Save Seamlessly: Manage your data using familiar tools and save your progress without navigating complex signature validation errors.

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.




