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: Reducing File Size.
by Allen Wyatt
(last updated December 4, 2019)
James complained about an oddity that he noted with his workbooks. He has a workbook to which he added some macros, and doing so increased the size of the file used to store the workbook. (This makes sense—the macros are stored with the workbook.) When James later deleted the macros, Excel did not shrink the size of the workbook file back to its original size.
This behavior is viewed by some as poor design in Excel—the macro data is removed, but the file size remains bloated. There are a couple of things you can try to again regain your svelte file size.
First, try using Save As instead of Save. Doing so causes Excel to create a brand new file for your workbook, and in the process, free up some space. If that doesn't work, you should try individually copying your worksheets to a brand new workbook, and then saving the new workbook. If doing that doesn't work, then you can try copying just the worksheet data (not the actual worksheets) to a different workbook. Obviously, this can become quite time-intensive.
Another thing to try, provided you still have some macros in the workbook, is a free utility called CodeCleaner, written by Excel MVP Rob Bovey. You can find the program on this page:
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2507) 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: Reducing File Size.
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!
If you have a problem that crops up when you first start Excel, it can be a bear to track down the cause of the problem. ...Discover More
Keeping tabs on the size of a workbook can be important when using Excel. You have a couple of options that will allow ...Discover More
Workbooks can get rather large rather quickly. If you think your workbook has gotten too big too fast, here are some ...Discover More
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
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.