
Tips.Net > ExcelTips Home > Macros > Managing Macros > Recovering Macros from Corrupted Workbooks
Summary: Corruption of a workbook can cause data loss. Sometimes it is a bigger problem to lose macros than it is to lose data. Here’s a couple different ways you can attempt to recover macros trapped inside a corrupted workbook. (This tip works with Microsoft Excel 97, Excel 2000, Excel 2002, and Excel 2003.)
Devarajan Balan 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/?kbid=142117 (for Excel 97) http://support.microsoft.com/?kbid=179871 (for Excel 2000 and 2002) http://support.microsoft.com/?kbid=820741 (for Excel 2003) http://www.jkp-ads.com/Articles/CorruptFiles.htm
Most of these pages refer specifically to recovering data, not to recovering the macros in a module associated with a workbook. One thing that you might try 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, such as the one available with Norton Disk Doctor. These tools 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.
Tip #2399 applies to Microsoft Excel versions: 97 2000 2002 2003
More Power! For some people, the prospect of creating macros can be scary. Those who conquer their fears, however, find they become much more confident and productive once they learn how to make Excel do exactly what they want. ExcelTips: The Macros is an invaluable source for learning Excel macros. You are introduced to the topic in bite-sized chunks, pulled from past issues of ExcelTips. Learn at your own pace, exactly the way you want.
Check out ExcelTips: The Macros today!
Thousands of ExcelTips, available for immediate download. Have all the Microsoft Excel info you need, right at your fingertips. (more information...)
Ask an Excel Question
Make a Comment
ExcelTips FAQ
ExcelTips Premium
Bugs and Pests Tips
ExcelTips
Family Tips
Health Tips
Home Tips
Organizing Tips
WordTips
Advertise on the
ExcelTips Site