ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Minimizing/Compressing VB Code in Excel File ... (https://www.excelbanter.com/excel-programming/326270-minimizing-compressing-vbulletin-code-excel-file.html)

Joe HM

Minimizing/Compressing VB Code in Excel File ...
 
Hello -

I was wondering if there is a way to somehow reduce the size of the VB
code so that the Excel file gets smaller. I have developed some code
in a template that will be used many times and I would like to reduce
the file size. Is there some way of compressing it? I was thinking
about stripping out all leading tabs/spaces and comments? Is there
anything else I could do?

Thanks!
Joe


Bob Phillips[_6_]

Minimizing/Compressing VB Code in Excel File ...
 
Another thing to try, which I don't think Rob's utility does, is to
re-create the project, by exporting the modules, and then importing then
into a new workbook. This often reduces the size (but it starts to grow
again as you further develop <g).

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Joe HM" wrote in message
oups.com...
Hello -

I was wondering if there is a way to somehow reduce the size of the VB
code so that the Excel file gets smaller. I have developed some code
in a template that will be used many times and I would like to reduce
the file size. Is there some way of compressing it? I was thinking
about stripping out all leading tabs/spaces and comments? Is there
anything else I could do?

Thanks!
Joe




Joe HM

Minimizing/Compressing VB Code in Excel File ...
 
Hello -

Thanks so much for the feedback! I tried Rob's utility and it actually
exports the modules and then re-imports them. That reduced the size of
the file. Then I used it to strip out comments and spaces.

The only thing I noticed is that when I did the export and re-import
AND stripping at the same time, Excel crashed. Weird ...

Thanks again!
Joe


Peter T

Minimizing/Compressing VB Code in Excel File ...
 
Rob Bovey has documented this problem which relates to stripping in class
modules like ThisWorkBook and Sheet modules. It's particularly problematic
in XL97 but I've also had this problem in XL2K (not often).

In Options, check "Ignore code behind document objects when stripping"

Regards,
Peter T


"Joe HM" wrote in message
oups.com...
Hello -

Thanks so much for the feedback! I tried Rob's utility and it actually
exports the modules and then re-imports them. That reduced the size of
the file. Then I used it to strip out comments and spaces.

The only thing I noticed is that when I did the export and re-import
AND stripping at the same time, Excel crashed. Weird ...

Thanks again!
Joe





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

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