Do macros in Excel increase file size?

L

lenoxjoe

I have an Excel file with multiple (220+)macros in it. Does this greatly
increase the overall size of the file?

If so, is there a way to reduce the file size (by manipulating the macros -
similar to compressing images)?
 
C

Chip Pearson

Macros certainly do increase the file size; anything you put in a
workbook increases its size. The question is really whether that
increased size is significant. And the answer to that depends on how
much code you actually have. My overall experience is that VBA code
doesn't increase the file size of a workbook significantly. One
embedded JPG can add as much, if not more, to the file size than would
a few thousand lines of VBA.

VBA is already stored in a somewhat compressed manner and there isn't
really a way to further compress it.

Cordially,
Chip Pearson
Microsoft MVP
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
The San Diego Project Group, LLC
(email is on the web site)
USA Central Daylight Time (-5:00 GMT)
 
S

Sean Timmons

Depending on the amount of code involved with the macros, in can increase the
file size. shouldn't be a huuuuge difference, though.

I would check my scroll bars. If they are tiny and scrolling to the bottom
takes you well beyond your data, then delete any excess rows/vcolumns beyond
your data, place your cursor within your data and save.

As for the macros, you can store them on your personal macro workbook. That
way, it doesn't increase your existing file's size.
 
D

Dave Peterson

If you save a copy of the workbook without the macros, you can compare the sizes
and see if that difference is great.

Rob Bovey has a utility called codecleaner that exports the code modules and
reimports them. This will reduce the size of the file--until the code is
recompiled. So if you save without recompiling (or running) the code, then
you'll see a reduction.

You can find it here:
http://www.appspro.com/
or directly
http://www.appspro.com/Utilities/CodeCleaner.htm

Personally, I've found that the biggest thing I can do is make sure that excel's
last used cell (of each worksheet) isn't too far from where I want it to be.

You can find some techniques at Debra Dalgleish's site for resetting the last
used cell:
http://www.contextures.com/xlfaqApp.html#Unused
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top