TheSwamp

Code Red => VB(A) => Topic started by: Kheilmann on September 20, 2007, 11:03:25 AM

Title: Best way to Lower File Size
Post by: Kheilmann on September 20, 2007, 11:03:25 AM
I've cleaned out a lot of my code, and removed old forms, etc.; however, the size of my
files either stay the same or increase.  I remember something about Compile on Command, but
not quite sure what it was. 

Thanks in advance for you help

Kevin
Title: Re: Best way to Lower File Size
Post by: Chuck Gabriel on September 20, 2007, 11:08:46 AM
Have you tried exporting all of your forms, modules and class modules, and then rebuilding the project from them?  That will typically get you a smaller dvb file.
Title: Re: Best way to Lower File Size
Post by: Keith™ on September 20, 2007, 11:19:53 AM
VBA is notorious for maintaining dead code in the file. Use Chuck's resolution and the files should be much smaller.
Title: Re: Best way to Lower File Size
Post by: Guest on September 20, 2007, 11:21:18 AM
I've noticed that simply doing a SAVE AS creates a much smaller file.
Title: Re: Best way to Lower File Size
Post by: Kheilmann on September 20, 2007, 11:29:02 AM
Thank You.  Worked well. 
Title: Re: Best way to Lower File Size
Post by: Kheilmann on September 20, 2007, 11:34:05 AM
My VBA (AutoCAD 2006) does not have a SAVE AS, just a SAVE.
Also, there is not a NEW Project.  In order to start a Project from Scratch, I have
to unload all current programs, and then the Global program will be available for me to
start developing.  And when I click "SAVE" here, it asks for location & name; however if the
DVB file was already saved, then it just resaves, there is no option to SAVE AS.

Am I missing something?

Thanks again for all your help.  My file shrunk from 4.8 Mb to 800 KB.
Also, how often should I export & import into a new file?  Seems like there should be
a way to Compile or decompile, etc. ????

Thanks again,

Kevin
Title: Re: Best way to Lower File Size
Post by: Guest on September 20, 2007, 11:36:16 AM
VBAMAN has a SAVE AS button.
Title: Re: Best way to Lower File Size
Post by: deegeecees on September 20, 2007, 11:44:32 AM
...there is no option to SAVE AS.

Am I missing something?

This is what you're missing:

Quote
Readme for the Menu Modification Sample

This Readme contains information about the Menu Modification sample.

=================
To Use the Sample
=================

The sample comprises two AutoCAD® VBA project (DVB) files. The acad.dvb
file calls the custom_menu.dvb file.

The sample adds items to the File menu in the AutoCAD VBA integrated development
environment (IDE), creates an AutoCAD menu in the IDE, and creates a toolbar in
AutoCAD®.

To use the sample
-----------------
1. Start AutoCAD and drag the acad.dvb file into AutoCAD.

2. On the AutoCAD Tools menu, click Macro > Macros.

3. In the Macros dialog box, in the Macro list, select the ACADStartup macro
   in acad.dvb.

4. Click Run.

Title: Re: Best way to Lower File Size
Post by: deegeecees on September 20, 2007, 11:47:37 AM
Alternately, you could move the files 'acad.dvb', and 'custom_menu.dvb' to a directory in the Acad support path, then they run automatically when AutoCad starts.