Excel Workbook Protection: Create an Audit Log
Question details
The user wants to know whether Excel's Protect Workbook feature records protection activity or creates a change history.
- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- The user needs an audit trail for workbook openings, sheet changes, protection activity, or other workbook events.
- Observed behavior
- Excel's built-in workbook protection does not automatically create an audit log or change history, and it has no dedicated event for protection changes.
Define which actions must be recorded, such as workbook openings, sheet changes, and user names. If you plan to use VBA, confirm that macros are allowed and identify whether the log will be stored in a worksheet, an external file, or another destination.
Use custom VBA events to build an Excel activity log
Use this approach when you need a custom audit trail for workbook openings, sheet changes, or other supported events.
Protect Workbook does not include a native audit-log feature. A VBA project can call a custom logging procedure from workbook and worksheet events, but Excel does not provide a standard event dedicated to changes in workbook protection. The logging design must therefore be adapted and tested for the required scenario.
In Excel, select File > Options > Customize Ribbon, enable Developer, and select OK.
Select Developer > Visual Basic, then open ThisWorkbook in the Project Explorer.
Add Workbook_Open or other supported workbook events, and call a custom LogChange procedure that writes the timestamp, user, workbook, sheet, and action to a log worksheet, file, or the Immediate window.
Return to Excel, save the workbook as an Excel Macro-Enabled Workbook (*.xlsm), enable macros, and test workbook opening, sheet changes, and Protect Workbook actions to confirm what is recorded.
Edit and manage compatible Excel workbooks with WPS Office
WPS Office is a free, lightweight alternative for opening, editing, and sharing common Excel workbooks with a familiar interface. It supports widely used Microsoft Office formats for easier migration, although Excel-specific VBA audit behavior and protection-change events should be tested separately.
- 1. Install WPS Office: Download and install WPS Office, then open WPS Spreadsheets from the Start menu or applications folder.
- 2. Open the workbook: Select Open from the home screen and choose the compatible .xlsx or .xls workbook you want to review or edit.
- 3. Review workbook protection: Use the Review tab to inspect available sheet or workbook protection controls, and test the file with a copy before relying on it for protected workflows.

Frequently Asked Questions
Does Excel Protect Workbook automatically record who changed protection settings?
No. Protect Workbook prevents or restricts structural changes, but it does not automatically record users, timestamps, protection changes, or a history of activity.
Can VBA create an audit log for Excel workbook activity?
Yes. VBA can write information from events such as Workbook_Open, sheet activation, and worksheet changes to a worksheet, external file, or the Immediate window. The logging code must be designed for the required actions.
Is there an Excel event for enabling or disabling workbook protection?
No. Excel does not provide a standard event dedicated to changes in workbook protection, so a VBA solution must use other events or custom checks and should be thoroughly tested.
Where can a VBA audit log store recorded activity?
A logging procedure can write records to a hidden or visible worksheet, a text or CSV file, or the VBA Immediate window. Choose a destination that users cannot easily overwrite if the log must support auditing.
What file type is needed for an Excel VBA audit system?
Save the workbook as an Excel Macro-Enabled Workbook (*.xlsm) so the VBA project can be retained. Users must also enable macros for the event-based logging code to run.




