Question: “I have a corrupted Microsoft Excel Macro-Enabled Workbook .xlsm file. How can I recover it?”

Please provide the English content you want to translate, and I'll promptly translate it into Chinese for you.

Possible Solutions: 1. Solution 1: Open and Repair Click "Open" on the "File" tab. Browse to the location...Full Steps 2. Solution 2: Set Calculation to Manual Create a new blank Excel file by going to "File" > "New"...Full Steps 3. Solution 3: Use External References Click "File" > "Open" > right-click on the folder...Full Steps 4. Solution 4: Open in Wordpad If Wordpad can open an Excel file with macros...Full Steps 5. Solution 5: Recover Macros Open Excel > Configure calculation settings...Full Steps

An Overview of a Damaged Excel File

When you try to open a workbook, if you receive one of the following errors (there are many variations), the workbook is corrupt:

  1. Error #1. Unable to open the Excel file
  2. Error #2. Microsoft Excel is not responding
  3. Error #3. The file is corrupted and cannot be opened
Related Articles

How Does an Excel File Get Corrupted?

Can't open your Excel workbook due to a corrupted file? How does an Excel file get corrupted? Can you recover a corrupted Excel file on Windows 10?

Microsoft Excel

Even if the file opens correctly in Excel, the data/formulas/macros stored in the workbook could be corrupted. In this article, we'll mainly focus on repairing a macro-enabled Excel file that encounters corruption issues.

"What is a Macro in Microsoft Excel?"

* This macro works in Excel for Microsoft 365, Excel 2019, Excel 2016, Excel 2013, Excel 2010, and Excel 2007.

If you have a task that you perform repeatedly in Microsoft Excel, you can record a macro to automate the task. A macro is a command, or series of commands, that you can run any number of times. When you create a macro, Excel records your mouse clicks and keystrokes. After you create a macro, you can edit it to fine-tune how it works.

What is a Macro-Enabled Excel (.xlsm) file?

For example, suppose you create a report for the accounting manager each month, and you want to highlight the names of customers with past-due accounts in red, bold type. You could create and run a macro to apply those formats quickly to the selected cells.

In Excel 2007 or later, when you create a workbook with macros enabled, the file extension changes from .xlsx to .xlsm. In short, these files are essentially the same, except that an .xlsm file will execute embedded macros written in the Visual Basic for Applications (VBA) language.

Is Macroeconomic Policy for Everyone?

Should macros be enabled in your day-to-day work? It depends. Given the significant security risks that can result from unexpected macros, Microsoft recommends that users avoid enabling macros in Office files unless they understand what the macro does and require the functionality that the file provides with macros enabled.

How to fix a corrupted Excel file with macros enabled?

When Microsoft Excel detects that a file is corrupted while opening it, it attempts to fix the issue. Minor problems are usually automatically corrected the next time you open the file in Excel. However, this isn't always successful, and for severely corrupted files, you'll need to troubleshoot further.

As mentioned earlier, macro-enabled files are XLSM files, while regular Excel files are XLSX (starting from Microsoft Excel 2007) and XLS (earlier versions like Excel 2003). The process of repairing a corrupted macro-enabled Excel file is similar to handling a damaged XLSX or XLS file. Usually, the five methods below are particularly useful for recovering a corrupted XLSM workbook in Windows 10, 8.1, 8, and 7.

Method 1: Use the "Open and Repair" tool

    Do the following: Click the File tab, and then click Open. Browse to the location and folder that contains the damaged macro-enabled workbook. In the Open dialog box, select the damaged workbook that you want to open. Click the arrow next to the Open button, and then click Open and Repair.

Repair a corrupted Excel file with macros using the Open and Repair tool

The next two options are "Repair" and "Extract Data." You can choose either one based on your needs:

    • To try to recover as much data from the workbook as possible, click Repair. • If Repair doesn't work, you can still extract values and formulas from the workbook by clicking Extract Data.

Method 2: Set Excel's calculation options to Manual

    1. Create a new blank Excel file by going to **File** > **New** > **Blank workbook**. 2. Click **File**, and then click **Options**. 3. Under the **Formulas** category, under **Calculation options**, select **Manual**, and then click **OK**.

Set calculations to manual to fix a corrupted macro-enabled Excel file

    Click File > Open, locate the damaged workbook, and then double-click to open it.

Method 3: Link to the Damaged File Using an External Reference

This method recovers data only from damaged Excel files with macros enabled, not formulas and calculated values in the workbook.

    1. Click "File" and then go to "Open." 2. Right-click on the folder containing the corrupted workbook. 3. Click "Copy," and then click "Cancel." 4. Click "File," "New," and then open a blank workbook. 5. In cell A1 of the new workbook, type **=FileName!A1**, where "FileName" is the name of the corrupted workbook from Step 3 (excluding the file extension), and press Enter. 6. If a "Recalculate Values" dialog appears, select "Damaged Excel" and click "OK." 7. If a "Select Sheets" dialog appears, choose the relevant sheet and click "OK." 8. Select cell A1, click "Home," and then click "Copy." 9. Starting from cell A1, choose an area approximately the same size as the data range in the damaged workbook. 10. Click "Home" and then click "Paste." 11. Repeat this process to copy all selected cells again: click "Home," and then click "Copy."

Repair corrupted Excel file with external references

Method 4: Open the Damaged Workbook in Wordpad

Trying to open a corrupted Excel file in Word might help, but only to a limited extent. In Word, you need to have the Microsoft Office Excel Converter installed, and your program will not be able to recover in that environment. Therefore, for a corrupted Excel file with macros, Wordpad would be a better choice than Word.

If Wordpad opens your Excel file enabling macros, you can restore important data and VBA procedures (macros) stored in the file by simply searching for Sub and Function in the recovered text.

Method 5: Recover Macros from a Corrupted File

If after trying these methods you are able to recover the data but not the macros, read on for one last hail-Mary attempt at recovering the macros.

    1. Open the Microsoft Excel application. 2. Set calculation options to "Manual" (refer to Method 2 for guidance). 3. From the "Tools" menu, choose "Macros," then select "Security." In Excel 2007, click the "Office Button," then click "Excel Options," and choose "Trust Center" from the left panel. Click the "Trust Center Settings" button, select "Macro Settings" on the left, choose "Disable all macros with notification," and click "OK" twice. 4. Open the corrupted workbook. If Excel can open the workbook, you'll see a prompt that macros have been disabled. If Excel closes, this method won't work. 5. Press Alt+F11 to open the Visual Basic Editor (VBE). 6. Using the Project Explorer (press Ctrl+R), right-click on a module and choose "Export File." 7. Enter a name for the module and choose a save location. 8. Repeat steps 6 and 7 as needed to export all modules. 9. Close the VBE and exit Excel. 10. Open a new blank workbook (or a new workbook containing recovered data from the corrupted workbook) and import the modules.

How can corruption issues in Microsoft Excel 2003/2007/2013/2016/2019 versions be prevented?

    Create a backup copy of the workbook automatically Save recovery information for the workbook at specified intervals

Indeed, only preventive measures can ensure the safety of our painstakingly created Excel workbooks. Efforts to back up or save auto-recovery copies are not just to prevent file corruption but also loss! Your crucial file may become inaccessible not only due to corruption but also because it was accidentally deleted, the disk was formatted, a virus attacked, or the transfer was interrupted….

So, it's crucial to keep your Big Data files safe. Aside from knowing the five ways on how to deal with corrupted files whether macros are enabled or disabled, you also need to find a reliable and powerful Excel file recovery tool to restore lost, deleted, or unsaved Excel files.

The Data Recovery Wizard, the best free data recovery software recommended by top website reviewers, is your first choice when you suffer data loss, whether it's documents, images, videos, emails or any other types of files. Data Recovery Software.

How to recover lost, deleted, formatted, or virus-infected Excel files:

Step 1: Choose a location and click "Scan"

Select the disk or a specific folder on your Desktop where the lost Excel file was located, and then click on the “Scan” button.

Select the location of your Excel file

Step 2: Locate your Excel file

To quickly find your Excel files from the scan results, click “Documents” on the left panel. Choose “Excel” and then click “Preview” to check if the Excel files are correct.

Scan for Lost Excel Files Scan for Lost Excel Files

Step 3: Recover Excel Files

Finally, select the required Excel file and click on the “Recover” button. After that, choose a folder to save the Excel file at another location.

Recover Excel File