Results 1 to 7 of 7
  1. #1
    5 Star Lounger st3333ve's Avatar
    Join Date
    May 2003
    Location
    Los Angeles, California, USA
    Posts
    705
    Thanks
    0
    Thanked 2 Times in 2 Posts

    A little less compilation? (Office XP SP-2)

    Long long ago, when I was a VB newbie, I added a Compile Project button to the VBEditor toolbar and got into the habit (which persists to this day) of compiling every time I saved my work -- i.e., a 2-button save (first Compile, then Save). This is a nice habit in the sense that compiling frequently means compile errors end up getting highlighted while the miscoding that caused them is still fresh in the coder's mind. But from the standpoint of Bloat and Corruption (which I capitalize out of respect), it has occurred to me that this constant project compilation may perhaps not be such a hot idea.

    What do the savvy Loungers do?

  2. #2
    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: A little less compilation? (Office XP SP-2)

    I'm not savvy, so I generally don't worry about it. If my template is too big, exporting the modules and importing them into a fresh template -- and NOT compiling -- will generates a smaller template. What I don't know is whether this affects performance for the new template. In other words, when the VBE stores the compiled code, does it then use that code or does it always recompile anyway (in which case, "cleaning" the template should be performance neutral)?

    In my limited experience, it is the forms that get corrupted, not the code modules, but I export backups of both regularly, just in case.

  3. #3
    Platinum Lounger
    Join Date
    Jan 2001
    Posts
    3,788
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: A little less compilation? (Office XP SP-2)

    To avoid bloat I use Rob Bovey's code cleaner. The Excel version is available from Office Automation Ltd. - The Excel MVP Page. A version for Word adapted by Robert Affleck and Bill Coan is available from the Word MVP site

  4. #4
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: A little less compilation? (Office XP SP-2)

    Well, I have just had a corrupted module last week, so those may be affected too. But I agree on the forms, those are most vulnerable, especially with Office 2000 (XP seems more stable with that respect).
    I too use both code cleaners, but have on occasion needed to actually copy and paste the code into a flat text file to really get rid of a corruption.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  5. #5
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: A little less compilation? (Office XP SP-2)

    I don't know what the savvy loungers do, but I do what you do with one exception - I don't worry about it!

    I am a tad more paranoid, or older. I have placed TWO compile buttons either side of the VBE Save - a bigger target means I'm more likely to compile before I save. If I could work out how, I'd substitute VBE's SAVE with a Compile-and-conditional-save, keeping the brute-force save in Word/Excel for emergencies.

    I figure that my development time is more valuable than the odd millisecond here and there. I'm better off finding writing errors ASAP.

    Like others I pass my projects through various cleaners to reduce bloat.

    Like some others I experience corruption with projects that modify their graphic items, such as forms and toolbars.

  6. #6
    5 Star Lounger st3333ve's Avatar
    Join Date
    May 2003
    Location
    Los Angeles, California, USA
    Posts
    705
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: A little less compilation? (Office XP SP-2)

    Thanks for the responses, gentlemen. I feel duly licensed to keep doing what I've been doing. I haven't downloaded any code cleaners, but I've got a macro that creates a new cleaned (I assume) copy of a designated macro template by exporting/importing the VBComponents and matching all the References, and I assume that generally leaves the Bloat & Corruption behind (especially for templates without forms or toolbars).

    As for my worrying, I'd like to note that if Word macro templates didn't take so <img src=/w3timages/censored.gif alt=censored border=0> long to Save, I wouldn't have all that time to worry. (Does anybody understand why Access databases save in the blink of an eye while saving a similar-sized Word macro template involves 10 seconds or so of hard drive activity?)

  7. #7
    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: A little less compilation? (Office XP SP-2)

    >Does anybody understand why Access databases save in the blink of an eye while saving a
    >similar-sized Word macro template involves 10 seconds or so of hard drive activity?

    Just some speculation... When Word saves, it goes through a little dance of creating a temporary file, then deleting the old file, then renaming the temporary file. It also probably does some maintenance on the OLE structures in the file. By contrast, a database is saved one tiny record at a time, and probably using different methods because the required space is pre-allocated in bulk by the OS and no changes to the directory or FAT are needed.

Posting Permissions

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