I have a fairly large VBA program (about 10k lines altogether, spread across maybe 40 different modules and 10 userforms) and the workbook that it runs off of has been getting increasingly large, to the point where it takes forever to open/save, and I often get memory errors, 'cannot display completely', or 'catastrophic failure' messages
The workbook is 130mb currently, and I haven't been able to figure out why. It has about 45 different sheets but there are only a few that hold a large amount of data (the rest are relatively small). When the program is running, a lot of data is being passed through various sheets, but for the most part my VBA code is explicity deleting the larger chunks of data when they're done being used.
As a test, I ran the code from this page, which saves each sheet to a seperate file:
http://dmcritchie.mvps.org/excel/saveas.htm
Altogether, the individually saved sheets only make up about 30mb. What could it be about my full workbook that is taking up so much space? I did a test to loop through and display the usedrange for each sheet, and nothing there was out of the norm. I'm explicity creating and then deleting any data connections and named ranges that are being used while the program runs. Any other ideas?
The workbook is 130mb currently, and I haven't been able to figure out why. It has about 45 different sheets but there are only a few that hold a large amount of data (the rest are relatively small). When the program is running, a lot of data is being passed through various sheets, but for the most part my VBA code is explicity deleting the larger chunks of data when they're done being used.
As a test, I ran the code from this page, which saves each sheet to a seperate file:
http://dmcritchie.mvps.org/excel/saveas.htm
Altogether, the individually saved sheets only make up about 30mb. What could it be about my full workbook that is taking up so much space? I did a test to loop through and display the usedrange for each sheet, and nothing there was out of the norm. I'm explicity creating and then deleting any data connections and named ranges that are being used while the program runs. Any other ideas?