How to Safely Share an Excel Workbook with VBA Macros
Question details
The user needs to distribute an Excel macro-enabled workbook securely without triggering security blocks or requiring users to manually change their Trust Center settings.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Sharing a macro-enabled workbook containing VBA code with users inside or outside an organization.
- Observed behavior
- Excel displays security warnings or automatically blocks the VBA code when users attempt to open the shared macro-enabled workbook.
Before distributing your macro-enabled workbook, ensure you have a valid code-signing certificate (issued by a commercial certificate authority or your internal IT department) and confirm that all VBA code is free of errors.
Digitally Sign the VBA Project
Apply a trusted digital certificate to your VBA macros so recipients can verify the publisher and run the code safely without altering global security settings.
Digitally signing your VBA project ensures that the code has not been tampered with since the signature was applied. When you sign your code with a trusted certificate, users will only need to trust your publisher profile once.
Open your macro-enabled workbook in Excel and press 'Alt + F11' to open the Visual Basic for Applications (VBA) editor.
In the VBA editor menu, click on 'Tools' and select 'Digital Signature' from the drop-down list.
In the Digital Signature dialog box, click the 'Choose' button and select the valid code-signing certificate you obtained from a Certificate Authority (CA) or your IT department.
Click 'OK' to apply the signature, close the VBA editor, and save the workbook as an Excel Macro-Enabled Workbook (.xlsm).

Distribute the File via a Trusted Location
Host the macro-enabled workbook in a designated Trusted Location so users on a shared network can run it without security blocks.
Seamlessly Handle Spreadsheets with WPS Office
If managing Microsoft Office Trust Center settings and digital certificates becomes too complex for distributing workbooks, consider using WPS Office. It provides a lightweight, free alternative with high compatibility for standard spreadsheet formats.
- 1. Download and Install: Visit the official WPS website to download the free installation package.
- 2. Open Your Workbook: Launch WPS Spreadsheet and open your existing Excel files directly.
- 3. Edit and Share: Edit your data seamlessly and share it with colleagues in universally accepted formats.

Frequently Asked Questions
Why are macros blocked by default in Excel?
Macros are disabled by default as a security measure to prevent malicious code from running automatically. Users must explicitly enable them after verifying that the file and its sender are trustworthy.
How do I get a code-signing certificate for my VBA project?
You can obtain a commercial code-signing certificate from a trusted third-party Certificate Authority (CA), request one from your organization's internal IT department, or create a self-signed certificate using 'Selfcert.exe' for personal testing.
What happens if I send an unsigned macro-enabled workbook to someone?
If you send an unsigned macro-enabled workbook, the recipient's Excel application will likely display a yellow security warning bar, or block the macros entirely depending on their Trust Center settings and organizational policies.




