Fixing “Excel found unreadable content” in .xlsm files.

The warning "Excel found unreadable content in 'filename.xlsm'. Do you want to recover the contents of this workbook?" appears when Excel encounters structural corruption inside a macro-enabled workbook. Because .xlsm files bundle standard worksheet XML files together with a compiled binary macro project (vbaProject.bin), corruption can occur in either layer. If you click “Yes” without a plan, Excel’s automated recovery routine often strips your VBA code entirely, leaving you with an ordinary spreadsheet and a non-functional automation system.

Quick Answer

Do not click “Yes” on your primary file. First, create a duplicate copy of the .xlsm file in File Explorer. Open Excel to a blank workbook, go to File > Open > Browse, select the copy, click the arrow next to the Open button, and select Open and Repair. If Excel asks whether to Repair or Extract Data, choose Repair.


The Dual Nature of .xlsm Files

A standard .xlsx workbook is a zipped folder containing pure XML text files. An .xlsm file contains those same XML sheets, but adds a compiled binary stream named vbaProject.bin.

Filename.xlsm (ZIP Archive)
├── [Content_Types].xml
├── xl/
│   ├── workbook.xml
│   ├── worksheets/
│   │   ├── sheet1.xml
│   │   └── sheet2.xml
│   └── vbaProject.bin  ◄── Stores compiled VBA macros and UserForms

When Excel reports “unreadable content,” the break usually stems from one of two issues:

  1. XML Schema Damage: A broken cell reference, damaged drawing object, or invalid custom style corrupts the sheet XML.
  2. Binary P-Code Conflicts: Excel compiles VBA into performance-optimized binary code called “p-code.” If a workbook last saved in 32-bit Excel is opened in 64-bit Excel, or if a Microsoft 365 update alters underlying system controls (like MSForms), the compiled p-code can conflict with the local Office environment, causing Excel to flag the entire binary stream as damaged.

Step 1: Open the Workbook with Macros Suppressed

Sometimes the workbook itself is structurally sound, but an automated macro, such as Workbook_Open() or Auto_Open(), crashes memory while loading, leading Excel to mistakenly report unreadable content.

  1. Launch Microsoft Excel.
  2. Go to File > Options > Trust Center > Trust Center Settings…
  3. Select Macro Settings.
  4. Choose Disable all macros without notification and click OK.
  5. Close and reopen Excel, then attempt to open your .xlsm file.

If the file opens without the error, the workbook structure is fine; a bug in your startup VBA routine is triggering the crash. Press Alt + F11 to inspect the code in the ThisWorkbook module, resolve any faulty runtime logic, and re-enable your normal macro settings.

Tip: You can also bypass startup macros on demand by holding down the Shift key while double-clicking the workbook to open it. Keep holding Shift until the grid fully renders.


Step 2: Run Built-In “Open and Repair”

If disabling macros does not resolve the error, use Excel’s built-in file repair utility on a duplicate copy.

  1. Open Excel to a blank document.
  2. Click File > Open > Browse.
  3. Locate and select your .xlsm file (do not double-click it).
  4. Click the small downward arrow on the right side of the Open button.
  5. Select Open and Repair…
+-------------------------------------------------------------+
| Open                                                        |
| ├─────────────────────────────────────────────────────────┤ |
| │ [ Open ] [▾]                                            │ |
| └──────────┬──────────────────────────────────────────────┘ |
|            │ Open Read-Only                                 |
|            │ Open as Copy                                   |
|            │ Open in Protected View                         |
|            │ Open and Repair... ◄─────────────────────────── |
+────────────┴────────────────────────────────────────────────+
  1. Click Repair.

If the file opens, inspect the repair report. If Excel states that it had to remove the /xl/vbaProject.bin part, your worksheets are saved, but your macros have been erased. Do not overwrite your original file. Proceed to Step 3 to salvage your code.

For more details on interpreting repair logs, refer to “We found a problem with some content in ‘filename.xlsx'”: Using the Open and Repair tool.


Step 3: Extract the VBA Code Using Archive Recovery

If Excel insists on stripping your macros during repair, you can extract the raw vbaProject.bin binary component directly from the workbook package.

  1. Open File Explorer and make a copy of your broken file.
  2. Rename the extension of the copy from .xlsm to .zip (e.g., Model.xlsm becomes Model.zip). Confirm the Windows prompt.
  3. Double-click Model.zip to explore its internal directories.
  4. Open the xl folder.
  5. Locate the file named vbaProject.bin.
  6. Copy vbaProject.bin and paste it onto your Desktop.
Model.zip/xl/
├── styles.xml
├── workbook.xml
└── vbaProject.bin  ──► [Copy to Desktop]

How to Re-Inject the Rescued VBA Project:

  1. Create a brand-new, clean .xlsm file in Excel and save it as Clean_Container.xlsm.
  2. Add a temporary blank macro module in Clean_Container.xlsm (via Alt + F11 > Insert > Module) so that Excel generates an internal VBA project structure, then save and close it.
  3. Rename Clean_Container.xlsm to Clean_Container.zip.
  4. Open Clean_Container.zip, navigate to the xl folder, and delete the existing vbaProject.bin.
  5. Drag and drop the vbaProject.bin file from your Desktop into the xl directory inside Clean_Container.zip.
  6. Rename Clean_Container.zip back to Clean_Container.xlsm.
  7. Open the file in Excel. Your macros will load inside the clean workbook shell without triggering the unreadable content prompt.

To repair underlying sheet data rather than macros using this extraction technique, review How to recover a “Corrupt” Excel file using the XML extraction method.


Diagnostic Step 4: Check Digital Signatures and ActiveX Controls

If the error only appears on specific computers, the workbook itself may not be damaged. Instead, security features or missing dependencies may be blocking the file.

  • Corrupted Digital Certificate: If the macro project was digitally signed and the security certificate has expired, been revoked, or suffered a hash mismatch, Excel blocks the binary payload and labels it unreadable. For troubleshooting steps, see Troubleshooting “Digital Signature” corruption in Macro-Enabled workbooks.
  • Missing 32-bit ActiveX Libraries: If your VBA project uses legacy Windows Common Controls (such as MSComctl.ocx for tree views or progress bars), attempting to open the workbook in a 64-bit installation of Excel can trigger unreadable content warnings. Re-register the controls using regsvr32 or migrate the code to modern 64-bit API declarations.