Results 1 to 8 of 8
  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

    Macro template saves slowly (Word 2002 SP-2)

    Edited: post#= (and brackets) added around the post# to create a live link. -Mod.[/i]

    I have a global template with macros and UserForms that's about 1MB. Any time I've made a change to the macro code in the template, it takes about 10 seconds to save (much slower than, for example, a 5MB Access library database), with the hard drive grinding away the whole time. This slow-save behavior happens regardless of whether the VBE window is open at the time of the save, and regardless of whether I perform the save from the VBE window or the main document window. On the other hand, if the only change I've made to the template is a change in the main document window (i.e., not a change to the macro code), the template saves quickly (whether I perform the save from the main document window or the VBE window).

    Is this typical Word 2002 behavior for templates with lots of macros and modules? (In case it's relevant, there are only 3 UserForms.) And if it's not typical behavior, does anyone know what the problem might be?

    This macro template originated in Word 97, but I'm virtually positive that at some point (perhaps just to try to address this issue) I created a new 2002 template, exported all the existing template's modules & UserForms, and imported them into the new template.

    PS: I've looked at the thread starting at <post#=307334>post 307334</post#>, but none of the suggested solutions there seem to apply to me (and it's not clear any of them worked for that poster either). Most notably, I'm at a stand-alone PC, not in a network setting.

  2. #2
    2 Star Lounger
    Join Date
    Jan 2004
    Location
    Mount Prospect, Illinois
    Posts
    142
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro template saves slowly (Word 2002 SP-2)

    My experience is that Word is a real pig in terms of saving VBA code. I've had templates grow by 500K during iterative editing (From about 1100-1600K) of VBA code, and speed of saving changes that include VBA code is always much slower than just doc content changes. Word 2000 was especially bad at this, I haven't had enough Word XP experience to tell if it's improved (plus, my machine is faster).

    Periodically, it's worth recreating the template: export all code modules, create a new doc, move the content, adjust the page setup, import all the code, and THEN use Organizer to move AutoText and Toolbars. Cuts the size of the whole thing down significantly.

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro template saves slowly (Word 2002 SP-2)

    The Word Code Cleaner will export, delete and import modules and userforms. It's a free download from the Word MVP site: Combatting Template Bloat.

  4. #4
    2 Star Lounger
    Join Date
    Jan 2004
    Location
    Kingwood, Texas, USA
    Posts
    112
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro template saves slowly (Word 2002 SP-2)

    Anyone know if this will work on Word 2003? Writeup stops with 2002. Thanks.

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro template saves slowly (Word 2002 SP-2)

    I don't have Word 2003, but I think the Code Cleaner will work there too. Although the Code Cleaner will create a backup copy of the template, it won't hurt making a backup copy yourself before running it the first time.

    You will probably have to tick "Trust all installed add-ins and templates" and "Trust access to Visual Basic project" in the Trusted Sources tab of Tools | Macro | Security.

  6. #6
    2 Star Lounger
    Join Date
    Jan 2004
    Location
    Kingwood, Texas, USA
    Posts
    112
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro template saves slowly (Word 2002 SP-2)

    Thanks. It appeared to work functionally although a little flakey in some ways. However, when done my normal template GREW about 30k.

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro template saves slowly (Word 2002 SP-2)

    If your template grows, it probably contained uncompiled code before exporting/importing the modules.

  8. #8
    2 Star Lounger
    Join Date
    Jan 2004
    Location
    Kingwood, Texas, USA
    Posts
    112
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro template saves slowly (Word 2002 SP-2)

    Could be but I compiled before I ran it. No big deal I guess at this stage.

Posting Permissions

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