Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Recovering Macros from Corrupted Workbooks.
Written by Allen Wyatt (last updated October 31, 2020)
This tip applies to Excel 97, 2000, 2002, and 2003
Devarajan ran into a situation where a workbook became corrupted, but he wanted to recover the macro module that was associated with the workbook. (The macros represented quite a bit of development time.) Devarajan wondered how the module could be recovered.
The answer depends, in large part, on how corrupted the workbook really is and where the corruption is located within the workbook. Much has been written about how to recover corrupted workbooks; the following resources will be of interest in this regard:
http://support.microsoft.com/kb/142117 (for Excel 97) http://support.microsoft.com/kb/179871 (for Excel 2000) http://support.microsoft.com/kb/820741 (for Excel 2002 and 2003) http://www.jkp-ads.com/Articles/CorruptFiles.asp
Most of these pages refer specifically to recovering data, not to recovering the macros in a module associated with a workbook. (It is interesting that the Microsoft Knowledge Base doesn't have any articles on recovering data from a corrupted Excel 2007 workbook. Perhaps one will come, with time.) One thing that you might try in order to get your macros is the following:
Another way to attempt recovery is to use OpenOffice, a free alternative to Microsoft Office. The spreadsheet program in OpenOffice will open Excel files, and it isn't as sensitive to some corruption issues.
If this still doesn't work, try using a low-level file manipulation tool that allow you to read files sector by sector from a disk, and then allow you to see the information in each sector. With most types of files this won't be very helpful. In fact, it wouldn't help you recover any data from an Excel workbook. Recovering macros is a different story, however. They are stored in the workbook in plain ASCII text, so you should be able to recognize the macro code and then copy it from the disk tool.
Note:
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2399) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Recovering Macros from Corrupted Workbooks.
Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!
Got a workbook cluttered with all sorts of macros? Delete them and you'll make your workbook easier to manage.
Discover MoreYou can manually copy macros from one workbook to another, but what if you want to automate the copying process? Here's ...
Discover MoreOpen up a workbook, and Excel normally runs the macros associated with that workbook. You can disable the automatic ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)
Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2024 Sharon Parq Associates, Inc.
Comments