How to Fix Removed Part xl/vbaProject.bin Error in Excel
Question details
The user encounters an error indicating that the embedded VBA project or macros have been removed from their Excel workbook.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Opening or saving an Excel workbook that previously contained VBA macros.
- Observed behavior
- An error message displays 'Removed part: /xl/vbaProject.bin', and all VBA macros are missing from the spreadsheet.
Before proceeding, locate any previous backups or original versions of your workbook, as VBA code that has already been stripped from the current file cannot be magically restored without a backup.
Recover from Backup and Save as .xlsm
Since the VBA project is already deleted from the current file, you must restore it from a backup and ensure it is saved in a macro-enabled format.
The most common cause of this error is saving a macro-enabled workbook as a standard .xlsx file. The .xlsx format cannot store VBA code, so Excel automatically strips the vbaProject.bin component during the save process.
Open the original or backup copy of the Excel file that still contains your macros.
Click on 'File' in the top-left corner of the Excel window and select 'Save As'.
Choose your destination folder. In the 'Save as type' dropdown menu, select 'Excel Macro-Enabled Workbook (*.xlsm)'.
Click 'Save' to securely store the file without losing your VBA project.

Edit Macro-Enabled Files in Desktop Excel
Avoid editing macro-enabled files in Excel for the Web or incompatible third-party editors, which can silently remove VBA content.
Check File Block Settings and Security Policies
Adjust Excel's Trust Center settings to ensure that your security policies are not automatically blocking and removing macros from downloaded files.
Safely Manage Macro-Enabled Workbooks with WPS Office
WPS Spreadsheet natively supports Microsoft Excel formats, including full compatibility for viewing, editing, and saving VBA macros. Use WPS Office to confidently manage your .xlsm files without unexpected data loss.
- 1. Launch WPS Spreadsheet: Open WPS Office and select the 'Spreadsheet' module.
- 2. Open your macro workbook: Click 'Open' to browse and open your backup file containing the VBA macros.
- 3. Save in the correct format: Go to 'Menu' > 'Save As' and choose 'Microsoft Excel Macro-Enabled Workbook (*.xlsm)' from the format dropdown.
- 4. Confirm and save: Click 'Save' to securely preserve all your data and embedded VBA scripts.

Frequently Asked Questions
Why did my Excel macros suddenly disappear?
Macros typically disappear if a macro-enabled workbook is accidentally saved as a standard Excel Workbook (.xlsx), which is a format that structurally cannot store VBA code. They can also be stripped if the file is edited in web-based spreadsheet applications that lack VBA support.
Can I recover the vbaProject.bin file from my corrupted .xlsx file?
No. Once a workbook containing macros is saved as .xlsx and closed, the vbaProject.bin (the VBA code) is permanently deleted from the file structure. You must recover your macros from an older .xlsm backup or the original file.
Does Excel for the Web support VBA macros?
Excel for the Web allows you to open and view macro-enabled workbooks, but it does not support running, editing, or managing VBA macros. Making structural changes in the web editor can sometimes lead to macro corruption or removal.
How do I prevent Windows from blocking my macros?
Windows often blocks macros in files downloaded from the internet. To prevent this, right-click the downloaded file, select 'Properties', check the 'Unblock' box at the bottom of the General tab, and click 'OK' before opening it in Excel.




