Results 1 to 5 of 5
  1. #1
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Compile = template bloat? (Eng/Word/2000 noSR)

    I have a template which, as usual, has bloated up on me. I exported the main module, and removed it, and saved. The template shrank to 189K. I imported the module again and saved the template, and it grew to 263K (fair enough). I compiled and saved again and the template grew to 355K. Hunh?

    I thought compilation was just an exercise in debugging, and that all VBA had to compile again at run time, so I don't understand why there is this significant file size growth when I compile. But maybe something else is happening here that justifies the bloat. Any ideas??

  2. Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Compile = template bloat? (Eng/Word/2000 noSR)

    What reference libraries are you including? Those things can bloat big time. I love to code with the libraries loaded to get the intellisense, but remove them before compile to production.

    On a related note, I noticed Payne has a new(er) version of Code Cleaner. Version 4.4. Haven't loaded it yet, so don't know what's new.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  4. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Compile = template bloat? (Eng/Word/2000 noSR)

    I have the standard stuff, Office, Word, MS Forms, plus ADO, ADOX, and maybe scripting. When you say you remove the references, are you switching to late binding (dim as Object, then using CreateObject)? I actually thought the reference was just a reference, and didn't affect code size. My evidence: if you run the template on a machine that does not have the referenced library (this happened a lot with DAO), it doesn't work. What am I missing here? Is it importing headers??

  5. #4
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Compile = template bloat? (Eng/Word/2000 noSR)

    I guess you are correct. I've been under the impression that the references bloated code. Where did I pick that up?

    Oh, well. After some testing with Code Cleaner I found my assumption clearly incorrect.

    So, anyway. Back to your problem. How about this: ( I know this works 'cause I've done it many times )

    Create a new blank template and using Organizer, copy over all your toolbars, styles, code, etc. Reinitialize the toolbars and keybindings, etc. and see if that don't shrink the puppy. My guess is there's "project metadata" or some such in a well-worn template.

    Even though I find Code Cleaner helpful, it does not shrink as well as the above procedure.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  6. #5
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Compile = template bloat? (Eng/Word/2000 noSR)

    I probably will do that when I go Gold. Problem is, I always forget a custom button or something. It seem quite slim when I first import everything, but by the time I get the buttons, AutoText, etc., back together, it isn't much smaller after all. Probably not worth the effort, really.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •