How to Restore Macros in Excel Spreadsheet?

A Macro is one of the most powerful but underutilized features of Excel. This can be defined as the recording of a series of tasks in an Excel workbook. Using the Macros will help you save your precious time and even increase your productivity. But sometimes, the Excel workbooks get corrupted and lead to data loss stored within it including macros. In this blog, I will discuss the common reasons for macros deletion and how to restore macros in Excel with ease.

To fix corrupt Excel files, we recommend this tool:

This software will prevent Excel workbook data such as BI data, financial reports & other analytical information from corruption and data loss. With this software you can rebuild corrupt Excel files and restore every single visual representation & dataset to its original, intact state in 3 easy steps:

  1. Try Excel File Repair Tool rated Excellent by Softpedia, Softonic & CNET.
  2. Select the corrupt Excel file (XLS, XLSX) & click Repair to initiate the repair process.
  3. Preview the repaired files and click Save File to save the files at desired location.

Why Do Macros Disappear?

Excel has various inbuilt features and functions to make the work easy for the users like macros. These macros sometimes go missing due to various reasons, including:

  1. File corruption
  2. Saved in the wrong format (e.g., .xlsx instead of .xlsm)
  3. Disabled macros in settings
  4. Unintentional deletion.

Best Software to Recover Macros In Excel

For the macros recovery in Excel, I recommend you all go with the powerful tool embedded with a strong algorithm i.e. MS Excel Repair ToolUsing this professionally recommended tool you can easily repair corrupt, inaccessible damaged Excel(.xls and .xlsx) files. This tool allows to easily restore all corrupt Excel files including the charts, worksheet properties cell comments, and other important data.

Try Now       Buy Now
* Free version of the product only previews recoverable data.

With the help of this, you can fix all sorts of issues, corruption, errors in Excel workbooks. This is a unique tool to repairs multiple excel files at one repair cycle and recovers the entire data in a preferred location. It is easy to use and compatible with both Windows as well as Mac operating systems. This supports the entire Excel version and the demo version is free.

Steps to Utilize MS Excel Repair Tool:

excel-repair-main-interface-1
stellar-repair-for-excel-select-file-2
stellar-repair-for-excel-repairing-3
stellar-repair-for-excel-preview-4
stellar-repair-for-excel-save-5
stellar-repair-for-excel-saving-6
stellar-repair-for-excel-repaired-7
previous arrow
next arrow

How to Restore Macros In Excel?

To make this Excel Macros recovery task easier for you, I have already suggested the software solution at the very beginning of this blog.

Method 1: Set the Calculation Method to Manual

When the Excel file fails to open the workbook on its own then this step will help you to fix the issue.

Follow steps to reset calculation setting:

  • Open Excel file but not the corrupted
  • Then from Tools menu > choose Options > click Calculation tab.
  • In Excel 2007, click the Office button > Excel Options > choose Formulas in the left panel.
  • Lastly in the Calculation section > click Manual >

Change The Calculation Setting

I hope doing this will help you to recover corrupted workbook data.

Now after setting the calculation mode to manual try the below-given steps to restore macros in corrupted Excel file.

Method 2# Change Macro Security Options

  • From Tools menu choose Macro > select Security > option.
  • Or in Excel 2007, click Office button > choose Excel Options > select Trust Center in the left panel.

Trust Center Settings

  • Next, click on the Trust Center Settings button > choose Macro Settings >Disable All Macros (without Notification in the Macro Settings section) > click OK
  • Then open the corrupted workbook and if the workbook opens, a notice appears Macros are disabled.
  • But if in case the Excel doesn’t open or shut down, then this method won’t work for you.

Also Read: Repair & Recover Corrupt Excel Files

Method 3# Export Personal Macro Workbook

Just like other VBA codes, Excel macros saved in the Personal.xlsb can easily be exported to the .bas file.

For exporting Personal Macro Workbook, perform the following steps:

  • Now hit Alt+F11 to open the Visual Basic Editor (VBE).
  • Now press Ctrl + R to use the Project Explorer > locate module you want to Save
  • And right-click the module name > select Export File

Set the Calculation Method to Manual

  • Close VBE > exit Excel
  • Close the VBA Editor and get out of Excel.
  • For importing .bas file which is shared by someone. Make a right-click on the module present in the PERSONAL.XLSB within which you are willing to store the macros. After that choose the Import File option.

Doing this will help you to recover macros from corrupted Excel file. This solution has worked for many users, so try it.

Method 4# Enable Personal Macro Workbook

When the macros disappeared in Excel, the very thing we all thought that it may get deleted. But in most cases, it is found that macros get hide after being disabled during an Excel crash.

Follow the steps mentioned below to find the Personal.xlsb file and execute it again.

Steps to Enable the Personal Macro Workbook

  • Open your Excel application first. After then go the File tab and hit the Options.
  • Tap to the Add-ins menu which resides on the left-hand side’s dialog box

Remove The Add-In

  • Within the Manage drop-down, choose Disabled Items
  • Now you have to select the Personal Workbook and tap to the Enable.
  • After performing all the steps restart the Excel Application.

Prevent Future Macro Loss

Here are the precautionary tips to be followed to avoid future macro loss:

  1. Keep backups of your Excel documents regularly.
  2. Save files as .xlsm to preserve macros.
  3. Export & save your macro code separately.
  4. Ensure macros enabled in trusted locations.

Frequently Asked Questions:

Where Is My Macro in Excel?

You will find macros in your Excel document by navigating to View > Macro > View Macros.

How Do I Recover an Unsaved Macro?

To recover an unsaved macro, you can use the Excel’s built-in Document Recovery feature. Click on ‘File’ > ‘Open’ > ‘Recent Documents’ > ‘Recover Unsaved Workbooks’ to see if there are any auto-recovery files.

Are Macros Saved in Excel File?

Yes, macros are saved in Excel’s Personal. xlsb.

How Do I Enable Macros in Excel?

You can enable macros in Excel, follow the below steps:

  • Open Excel, go to 'Security Warning' section.
  • Click on 'Enable Content' to get a dropdown window for further options.
  • Now, click on 'Advanced Options’ >> 'Enable content for this session. '
  • Finally, choose 'OK' to approve the action.

Also Read: Recover 0 Bytes Excel Files

Final Verdict:

This is all about how to restore macros in Excel file. I have tried my best to share the best methods to recover Excel macros. So, do try all of them, and don’t forget to share your experiences with us.

Additionally, it is recommended to handle the Excel file properly and follow the best preventive steps to protect Excel files from getting corrupted.

Good Luck….



Priyanka is a content marketing expert. She writes tech blogs and has expertise in MS Office, Excel, and other tech subjects. Her distinctive art of presenting tech information in the easy-to-understand language is very impressive. When not writing, she loves unplanned travels.