ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Do macros in Excel increase file size? (https://www.excelbanter.com/excel-discussion-misc-queries/205743-do-macros-excel-increase-file-size.html)

lenoxjoe

Do macros in Excel increase file size?
 
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)?

Chip Pearson

Do macros in Excel increase file size?
 
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)


On Thu, 9 Oct 2008 13:43:01 -0700, lenoxjoe
wrote:

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)?


Sean Timmons

Do macros in Excel increase file size?
 
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.

"lenoxjoe" wrote:

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)?


Dave Peterson

Do macros in Excel increase file size?
 
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 he
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


lenoxjoe wrote:

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)?


--

Dave Peterson

Jim Thomlinson

Do macros in Excel increase file size?
 
Even at 220+ macros the increase in the file size is not going to be huge.
There is a discussion at the attached link about decreasing the file size of
the code by de-compiling it. In VBA there is no real benefit to compiled
code...

http://orlando.mvps.org/VBADecompile...IdC=OrlMoreWin
--
HTH...

Jim Thomlinson


"lenoxjoe" wrote:

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)?



All times are GMT +1. The time now is 11:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com