Fix Excel Macro Workbook Opening Without Worksheets or Data
Question details
User needs to recover data and worksheets that disappear from macro-enabled Excel workbooks after saving and reopening.

- Product
- Microsoft Excel
- Device & OS
- Mac
- Scenario
- Opening a previously saved macro-enabled workbook (.xlsm) after enabling macros.
- Observed behavior
- Worksheets and data completely disappear from the workbook after macros are enabled, saved, and reopened.
Immediately stop saving over the original files to prevent permanent data loss, and create a backup copy of your workbook to use while testing these troubleshooting steps.
Bypass Auto-Running Macros and Inspect VBA Code
Prevent macros from running automatically on startup to determine if a script is actively hiding or deleting your worksheets.
Often, VBA code tied to the 'Workbook_Open' or 'Auto_Open' events can maliciously or accidentally alter the workbook state, setting sheets to 'VeryHidden'. Holding the Shift key overrides these auto-executing scripts.
Hold down the 'Shift' key while double-clicking your Excel file. Keep holding it until the workbook fully opens to bypass automatic macros.
Press 'Option + F11' on your Mac (or 'Alt + F11' on Windows) to open the Visual Basic for Applications Editor.
In the Project Explorer pane on the left, click on each worksheet name. In the Properties window below it, check the 'Visible' attribute. Change any hidden sheets to '-1 - xlSheetVisible'.
Double-click 'ThisWorkbook' and look for scripts that execute on open or close events which might be modifying worksheet visibility or deleting content.
Restore an Earlier Version of the Workbook
Recover your lost data by rolling back to a version of the file saved before the macros were executed.
Reinstall or Rollback Microsoft Excel
Resolve potential bugs in your specific build of Microsoft Excel that cause abnormal macro handling.
Try WPS Office for Stable Macro and Data Management
If Microsoft Excel updates are causing macro compatibility issues or unexpected behavior, consider switching to WPS Office. It provides robust, reliable support for VBA and macro-enabled workbooks (.xlsm) in a lightweight, completely free, and highly compatible suite.
- 1. Download and install: Get the free WPS Office suite from the official website and install it on your device.
- 2. Open your macro workbook: Launch WPS Spreadsheets and safely open your existing .xlsm files without format loss.
- 3. Enable or disable macros securely: Use the Developer tools in WPS Spreadsheets to safely manage, inspect, and execute your VBA code.

Frequently Asked Questions
Why did my worksheets disappear right after enabling macros?
Macros often contain VBA code (such as 'Workbook_Open' or 'Auto_Open') that executes immediately upon authorization. If the script contains commands to hide or delete worksheets, they will vanish as soon as you click 'Enable Macros'.
How do I unhide worksheets that were hidden by a macro?
Open the VBA Editor by pressing Option + F11 (Mac) or Alt + F11 (Windows). In the Project Explorer, click on the hidden sheet. In the Properties window below, find the 'Visible' property and change it from 'xlSheetVeryHidden' to '-1 - xlSheetVisible'.
Will reinstalling Excel restore my missing data?
No. Reinstalling Excel only fixes software application errors and bugs. If a macro has deleted or hidden data within the specific workbook file, reinstalling the software will not restore that data. You must fix the VBA code or restore a backup.
How can I open an Excel file on Mac without letting macros run?
Hold down the 'Shift' key while double-clicking the Excel file. Keep holding Shift until the workbook has fully loaded. This starts the file in a safe mode that prevents any startup macros from running automatically.




