VBA & Macro Problems

How to Remove Hidden Macros or VBA Modules from an Excel Workbook

Algirdas JasaitisAlgirdas Jasaitis Nov 11, 2026 868 views

Question details

The user needs to permanently remove hidden macros or empty VBA modules from an Excel workbook to clean up the file and restore features like AutoSave.

How to Remove Hidden Macros or VBA Modules from an Excel Workbook
Product
Excel
Device & OS
not provided
Scenario
Eliminating all VBA content from a workbook when no macro procedures are visibly listed in the standard Macros dialog box.
Observed behavior
The workbook retains hidden VBA modules or lingering project data, preventing AutoSave from functioning and unnecessarily triggering macro warnings.
Before you start

Before stripping macros from your workbook, verify that no automated tasks or custom functions rely on the VBA code. It is highly recommended to save a backup copy of your original macro-enabled (.xlsm or .xlsb) file.

Solution 1Recommended

Save the File as a Standard Excel Workbook (.xlsx)

The fastest and most reliable way to remove all VBA code and macro modules from a workbook is to save it in a macro-free format.

By saving your workbook as a standard .xlsx file, Excel automatically strips out all VBA projects, macros, and ActiveX controls while preserving your data, charts, and formulas.

1
Open Save As

Click on the 'File' tab in the top ribbon and select 'Save As'.

2
Choose the .xlsx Format

In the 'Save as type' drop-down menu, select 'Excel Workbook (*.xlsx)'.

3
Save and Confirm

Click 'Save'. A warning dialog will appear stating that VB projects cannot be saved in macro-free workbooks. Click 'Yes' to confirm the removal of the macros.

4
Reopen the Clean File

Close the current file and open the newly saved .xlsx file. It is now completely free of VBA content.

Save the File as a Standard Excel Workbook (.xlsx)
AutoSave Restored: Once the file is saved as a standard .xlsx and uploaded to OneDrive or SharePoint, the AutoSave feature will be fully functional again.
Manage Macros Easily with WPS Office

Easily Strip Unwanted Macros using WPS Spreadsheet

WPS Office provides robust spreadsheet tools that handle macro-enabled files seamlessly. You can easily strip unwanted macros by saving your files in a macro-free format using WPS Spreadsheet.

  1. 1. Open Your Workbook: Launch WPS Spreadsheet and open your macro-enabled workbook.
  2. 2. Navigate to Save As: Click on the 'Menu' button in the top left corner and choose 'Save As'.
  3. 3. Select Macro-Free Format: Select 'Excel Workbook (*.xlsx)' from the file type drop-down list.
  4. 4. Save and Remove Macros: Click 'Save' and confirm the prompt to permanently remove the macro project from the new file.
Fully compatible with Microsoft Excel formats including .xlsx, .xlsm, and .xlsb.Lightweight and fast, opening heavy macro-enabled workbooks in seconds.Familiar user interface with no learning curve required.Free to download with powerful built-in data analysis tools.
microsoft office alternative - wps office

Frequently Asked Questions

Why do I get a macro warning when there are no macros listed in the Macros dialog?

Your workbook likely contains empty VBA modules, class modules, or leftover code in the background (such as Worksheet_Change events). Even completely empty modules can trigger macro security warnings. You must delete these modules in the VBA Editor to stop the warnings.

Will saving my file as an XLSX delete my formulas or formatting?

No. Saving a file as a Standard Excel Workbook (.xlsx) will only remove VBA code, macros, and ActiveX controls. Your formulas, cell data, charts, and standard formatting will remain completely intact.

How do I view hidden macros if the Developer tab is disabled on my ribbon?

You do not need the Developer tab to access the backend code. You can bypass the ribbon entirely by pressing Alt + F11 on your keyboard to directly launch the Visual Basic Editor, where all modules and macros are visible.