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

    Neverending template save (Word 2002 SP-2)

    Last night I compiled and then tried to save a global template (containing macros) that I had open in the VBE window. Hitting the Save button was followed by endless hard drive activity. I finally shut Word down with the Task Manager, after which I found that the Startup directory (where the template resides) contained a ~xxx.tmp file that was around 550 MB. I had this same experience a while back, with a different global macro template, and that time (after I waited longer to shut Word down) the resulting ~xxx.tmp file was around 1 GB. (I suspect that, in each case, Word was in some kind of loop and would have filled the whole hard drive with the tmp file if I hadn't shut it down.)

    The template I was trying to save was around 1.2 MB and wasn't dramatically bloated. (After the hang, I copied its modules into a new template, compiled and saved, and that reduced it to around 900 KB.)

    I'm pretty good about saving my work, so I didn't lose much this time, but I'm wondering:

    1. Have others experienced this? Once in a blue moon? On a semi-regular basis?

    2. Any insight into causes and/or tips on how to avoid?

  2. #2
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Neverending template save (Word 2002 SP-2)

    st3333ve,

    The fact that no one has to date responded, would indicate that this is not something anyone's encountered.

    A couple of questions:

    If you go to Tools > References, are there any unusual references set? If so, try removing those references and see if that affects the problem.

    Are there any other global templates running, at the time you save this one? Any other applications that interact with Word?

    It might also be interesting to examine the contents of those bloated .tmp files - you can always change the file extension from .tmp back to .doc, and open them in Word - but at 550 MB, maybe opening them is not a good idea!

    Gary

  3. #3
    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: Neverending template save (Word 2002 SP-2)

    Thanks for the response. No unusual references.

    My macros are currently in 4 global templates. One is tiny (60KB, with just a few error-handling and other VBE-related procedures that duplicate procedures in the Utility template to avoid the circular reference problem), and another contains all my UserForms and a few UserForm-related procedures (only 5 UserForms at this point, since 3 of them are "form" UserForms that get used for various purposes -- reconfigured at runtime as necessary, mostly by adjusting .Visible and .Top properties). Then there's a Utility template and what you might call a Main macros template. Whenever I'm running Word, they're all loaded, so the other 3 will always be loaded whenever I'm saving one of them.

    The UserForms template references the tiny selected-duplicates template. The Utility and Main templates each reference the UserForms template. And the Main template references the Utility template.

  4. #4
    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: Neverending template save (Word 2002 SP-2)

    Thanks for the response.

    I did some experimenting that seemed to indicate that copying the VBComponents to a new template using the Organizer (through VBA) resulted in a de-bloated template that was the exact same size as a de-bloated template achieved by exporting and importing the VBComponents, so my "Rejuv" macro has been using the Organizer. Anybody know if this is a bad idea?

    My KeyBinding and CommandBar changes can all be re-created by macro, and I store all the KeyBindings and CommandBars in my Normal template (which has no macros) rather then including them in any template that also contains macros. And on a related (I think) note, the steps I've been taking to de-bloat my macro templates haven't included deleting the data key. Does this make sense?

    Incidentally, I'm anticipating that Word 2018 or 2019 will fix these corruption issues. Am I being too optimistic?

  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: Neverending template save (Word 2002 SP-2)

    > exact same size as a de-bloated template

    We're not looking for exact-same-size here, are we? Assuming that it's a corruption problem, we're looking for "without corruption" which, logically, could mean a larger file as a result, if the original corruption had taken the form of something missing.

    When it gets to 986MB of a ~.TMP file, I don't trust Word father than I can poke at it with a rolled up newspaper made with NotePad.exe, which is why I swear by ASCII files.

    Let's assume that the corruption is caused by Word. Why trust Word NOT to ferry the existing corruption to a new template? Instead, export the modules by Payne's/Coan's/Bovey's VBA Code Cleaner. Once your code/form/class modules are in ASCII files, you *know* that there are no pointers, so you know that there can't be any *corrupted* pointers. Then import your modules right back into Word
    . Bonus: You'll have a lovely archive copy of your source.
    I export/import modules via ASCII text files; i don't try to copy anything else, especially Toolbars.

    (You'll note that I'm so paranoid that I reboot Windows, not just exit-and-reload Word. That takes long enough for me to wash the supper dishes, so I also get to wash my hands!).


    Regarding the DATA key in the registry: I delete it, then I reload Word to let Word create a new DATA key, then I quickly customize Word (re-arrange my toolbars, make the Format toolbar invisible etc.), exit Word and then export the new DATA key to a safe place. One of these days I'm going to include a command in my WordXP.BAT file to load the pristine Word.REG file to the registry, the same way I currently load my pristine template right over the top of Normal.DOT. (attached: You'll notice that I'm up to generation 047 of my Normal.bat)


    Re 2018 or 2019: Microsoft won't be around then (all succesful companies have a habit of becoming unsucessful, the same way a green light turns red), so we won't be having Word problems then. You can bet on that. The *BAD* news is that gates will pick up programming again as a hobby, and discover Open Source.
    Attached Files Attached Files

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

    Re: Neverending template save (Word 2002 SP-2)

    > contained a ~xxx.tmp file that was around 550 MB.
    (I saw this because Gary responded and freshened the screen display!)

    I have experienced this problem about four times in the past six weeks, only after upgrading to Office XP from '97.

    With '97 my VBA application templates would become corrupted and un-readable. My solution is to use Payne's Code Cleaner and disable its action to delete the exported modules, leaving them in place. I reboot Windows, just to be on the safe side, and in Word create a new template and import the BAS and FRM files. I don't try to copy the toolbar because I've had toolbar corruptions linked to the infamous data registry key (<!post=FOURTH STEP: Delete the data key ,197827>FOURTH STEP: Delete the data key <!/post>; I recraft the toolnbar menus lovingly by hand.

    I'm glad that you save frequently. Corruption in '97 templates seemed to be indicated by problems with GUI forms, but I can't prove that. I wrote a macro that re-saves with an upgraded file name on demand (DonsR001.dot, DonsR002.dot, DonsR003.dot, etc.) just to ensure an adequate supply of audit-trail droppings). I figure that numbers are free and disk space is cheap, at least up to ).5 to 1G)!

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

    Re: Neverending template save (Word 2002 SP-2)

    > My macros are currently in 4 global templates

    I don't think it's anything to do with the number of templates. I think it's to do with what we do when we shuffle stuff around during editing, mainly because my "endless saves" arise when I'm editing. But then, I spend most of my time editing VBA code.

    Attached is my StarupFolder contents *.DOT. A few years back I copy/pasted multiple copies of everything into Starup, just to see how Word97 handled large numbers of DOT. It failed after the 256th DOT, so we are well within bounds of decency.

    Some of my aps allow me to change GUI colours, fonts, captions and control-tip text on the fly. I use GUI forms with buttons that allow me to slide listbox widths to greater or lesser heights. All sorts of weird mechanics.

    But I don't seem to get corruption (in the '97 or 'XP sense) when I'm using, only when I'm editing.
    Attached Files Attached Files

  8. #8
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Neverending template save (Word 2002 SP-2)

    Hi again,

    I've had multiple global templates before, as well as numerous regular templates which all referenced a specific global template, but haven't ever had multiple global templates that reference each other. You've avoided circular references, but there are still some cross-links - don't know if that should matter, but since we're grasping at straws: which of these templates is causing the loop on save? Just as an experiment, perhaps you could temporarily remove all references to/from this template, and see if the save problem goes away?

    Gary

  9. #9
    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: Neverending template save (Word 2002 SP-2)

    The 2nd never-ending save was the Utility project. I'm pretty sure the first one was the Main project. Since it's only happened twice (and with 2 different files), it's not really a situation (at least not yet) where I can temporarily try something and see if the problem goes away. I'll try to keep de-bloating on a regular basis and see if that keeps me out of trouble.

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

    Re: Neverending template save (Word 2002 SP-2)

    > post-de-bloat size, it must mean the exact same baggage
    Nah. You and I might both be 5'6", slim build etc, but, I assure you, different baggage.

    >What's a "pointer" anyway? Is it similar to a geometrical "point" in not taking up any space? (Don't answer that question.)
    Which question did you want me not to answer (don't bother (grin!))

    "Pointer" in this context, is an integer memory address, where "memory" can mean actual silicon RAM, or even just an programmer's index into a VBA array. I believe that Word DOC/DOT are built, as are many complex files, of chunks of really useful stuff scattered about the file. Pointers are the address tags that indicate where each part is. Hard drives use pointers to link together all the defragmented pieces of a single file.

    A Pointer is strangely similar to a geometric point, in that the space it uses is almost-zero. If you think about, say, a 200KB document in memory, the address that points to it might be a 64-bit address, but that's still only eight 8-bit bytes, so 8-bytes as a pointer to 200KB is close-to-zero.

    The best example of a pointer that can be understood by everyone is a business card. It is a pointer to a real person, and you can tear up/destroy the pointer without destroying the person. Likewise you can have several pointers, each pointing to a single object/person.

    Hope that helps ....

  11. #11
    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: Neverending template save (Word 2002 SP-2)

    Thanks for the further follow-up. Well, I just figured if it ended up the same post-de-bloat size, it must mean the exact same baggage was and wasn't being brought over.

    What's a "pointer" anyway? Is it similar to a geometrical "point" in not taking up any space? (Don't answer that question.)

    At any rate, you'll be pleased to hear I have today rejiggered my CopyVBComponents procedure -- called by CopyCodeModule, which is called by Rejuv (the de-bloater) -- so that it exports and imports, rather than using OrganizerCopy.

Posting Permissions

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