PDA

View Full Version : Mysterious file growth on sorting



Sebastian H
11-11-2010, 02:54 AM
OK, this question has nothing to do with VBA, but I hope it's still OK to ask here, seeing as "Reduce Excel File Size (http://www.vbaexpress.com/forum/../kb/getarticle.php?kb_id=83)" is listed as the top most useful KB entry here (http://www.vbaexpress.com/kb/default.php).

When I sort the attached file thiswillgrow.xls by column A (ascending), it will grow from 33 to 39 KB. This may not seem much, but this is only a small version of the original file, stripped down to the bare bones. The original file grows by about 70%, or 3.3 MB. The growth is very predictable; I compiled a table with different results for different intermediate sizes; if anyone's interested. BTW, I'm using XL 2003 under Win XP.

What makes this even more mysterious is that column A is already sorted. So there's no reason for anything to change in the file.

To reset the file size, proceed as follows: Quit Excel (and save the file, if you like), and then open Excel again and save the file again while it is still unspoiled.

Any idea what causes the growth, and how to prevent it? The file does need to be sorted repeatedly, so not sorting it is not an option.

Sebastian H
11-11-2010, 03:17 AM
I just realized that there was one more thing I could delete; the conditional formatting. That doesn't change the behavior, but I am attaching the further stripped down file so that we have a file that really only contains bits related to the problem.

It seems like the formulas need to be there to reproduce the problem; when I replace all cells with their values, the file size does not change anymore.

Sebastian H
11-11-2010, 03:50 AM
I went back to the original file and did the same replacement (in the sorting column only), and the growth still happened, but it was 2.7 MB instead of 3.3. When I replaced all formulas in the whole sheet with their values, it stopped happening. So it seems to be connected with the presence of any formula.

Simon Lloyd
11-18-2010, 02:51 PM
Sebastian, my only suggestion would have been turning off track changes/history. For further hep with formulae..etc take a look at Charles Williams' site loads of great stuff there http://www.decisionmodels.com/

Sebastian H
12-07-2010, 09:39 PM
Thanks for the reply. I don't have Track Changes activated, and by "History", I presume you mean the same thing, right?

This problem isn't as high on my priority list anymore since I reduced the number of formulas; many fields don't normally have to be recomputed, and I wrote another macro that inserts the correct functions when they are needed.