How to Fix Excel Repairing XLSM Files and Removing Formulas
Question details
Excel forcefully repairs large XLSM workbooks, removing complex formulas and VBA, leaving only cached values.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Opening a large XLSM workbook containing cloud storage links, VBA, and complex modern functions (like LET, LAMBDA, XLOOKUP, MAP, SWITCH, and CHOOSECOLS) after a recent security update.
- Observed behavior
- Excel prompts a repair process that strips out formulas and VBA macros, replacing them with static cached values.
Create a backup copy of your affected XLSM file and set it to read-only before attempting any troubleshooting steps to ensure you do not overwrite the original data.
Open the XLSM File in Windows Excel
Since the repair-engine behavior differs between operating systems, a file that triggers a destructive repair on Mac may open flawlessly on a Windows PC.
Compatibility and repair engine defects occasionally affect macOS versions of Excel more aggressively than Windows versions. Transferring the file to a Windows environment can sometimes bypass the forced repair and preserve your VBA and complex formulas.
Copy the corrupted XLSM file to a computer running the Windows version of Microsoft Excel.
Temporarily disconnect the computer from the internet. This prevents OneDrive from syncing and disables AutoSave during your test.
Open the file in Windows Excel. Check if the repair notice is bypassed and if your LET, LAMBDA, and XLOOKUP formulas remain intact.
If the file opens successfully, go to File > Save As and save the workbook under a completely new name before transferring it back.

Download an Earlier Version from Cloud Storage
If the file structure is permanently damaged by the security update, retrieving a known-good version from OneDrive is the most reliable fallback.
Collect Repair Logs for Microsoft Support
If the issue is caused by a documented compatibility or repair-engine defect, providing Microsoft Support with detailed logs will aid in a fix.
Try WPS Office for Better XLSM Compatibility
If Microsoft Excel continues to incorrectly repair and strip formulas from your XLSM files, try opening them in WPS Office. It provides robust compatibility with advanced spreadsheet functions and VBA macros without the aggressive forced repairs of recent updates.
- 1. Download and Install: Get WPS Office for free from the official website and install it on your computer.
- 2. Open Your XLSM File: Launch WPS Spreadsheets and open your XLSM file directly to view your formulas and macros intact.
- 3. Save and Continue: Edit your workbook and save it in the standard Microsoft Excel format without losing compatibility.

Frequently Asked Questions
Why does Excel replace my formulas with cached values during a repair?
When Excel detects file corruption or encounters a compatibility issue with complex formulas (like LET, LAMBDA, or XLOOKUP) after a security update, its repair engine may strip out the unreadable components to salvage the calculated data, leaving only static cached values behind.
Should I use LibreOffice to recover my corrupted XLSM file?
It is not recommended. While LibreOffice might open the workbook without immediately triggering Excel's repair prompt, it lacks full compatibility with modern Excel functions and VBA. Saving the file in LibreOffice may cause permanent loss of these advanced elements.
How can I prevent AutoSave from overwriting my corrupted file?
Before opening a potentially corrupted workbook, disconnect your computer from the internet or open a copy of the file from a local, non-synced folder. This prevents AutoSave from automatically syncing the stripped, repaired version back to your OneDrive.
Does the operating system affect how Excel repairs files?
Yes, the Excel repair engine behavior can differ between Windows and macOS. An XLSM file that triggers a destructive repair and removes VBA on Mac Excel might sometimes open perfectly fine in the Windows version of Excel.




