Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Denmark
    Posts
    347
    Thanks
    0
    Thanked 0 Times in 0 Posts

    File size grows when compiling (W2K/O2K pro UK,)

    Just wondering...

    Can anyone explain to me, why my Word .dot files grows when compiled ?

    I had a file I've been working on for some while, after final development works were done it was approx. 2.4mb.
    Then I exported all modules and made a new .dot to which they were then imported. (File size fell to 744K.
    Then I compiled it and was ready to release test it. (but was somewhat stunned to see that after compiling it had grown to 1.3mb)

    Any good explanations on this....( normal "growth" I expect must be the result of some kind of "append" operation going on in the "Word engine")


    ;o)) Henrik


    PS: No Office version up- or downgrades are involved here, it's all O2K.
    Bests,
    RD


    PS: Wish there were a knob on the TV to turn up the intelligence. There's a knob called "brightness," but that doesn't work

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

    Re: File size grows when compiling (W2K/O2K pro UK,)

    It is because compiling adds "machine like" code to the file, which VBA uses to do the execution (or so I gather <g>).

    BTW: are you aware there is a Word code cleaner utility that simplifies the job of exporting, deleting/importing? Find it here:

    http://www.mvps.org/word/FAQs/Macros...plateBloat.htm
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  3. #3
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Denmark
    Posts
    347
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: File size grows when compiling (W2K/O2K pro UK,)

    Thanks,

    Yes I'm aware of the code cleaner and has used it in various situations.
    However, it is not a 100% efficient. we did a test using both methods and there was some difference - favouring the manual way.
    But for general purposes I do agree - it's sufficiently efficient.


    Thanks again,
    ;o) Henrik
    Bests,
    RD


    PS: Wish there were a knob on the TV to turn up the intelligence. There's a knob called "brightness," but that doesn't work

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

    Re: File size grows when compiling (W2K/O2K pro UK,)

    The reason it is not entirely efficient is that VBA does a terrible job cleaning after itself.

    Try this:

    Dim sTest as String

    Now type:

    stest="Hi"

    You'll see it change to:

    sTest="Hi"

    Now remove the dim statement and redo the typing. VBA still remembers the DIM and capitalises!

    Another point to be aware of, is that code inside Object modules (Thisdocument e.g.) cannot be cleaned. Therefore copying all your code to a fresh doc will be different from using code cleaner. It is for this reason I tend to put as little code as I possibly can into those modules.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  5. #5
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Denmark
    Posts
    347
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: File size grows when compiling (W2K/O2K pro UK,)

    Interesting....

    Wasn't aware of the Object module issue, but has never put much code in there myself either always used "clean" modules.
    (found unconsciously that they provided a better structure and fewer problems - now I know what can be one of the reasons, thanks)

    If I read your previous mail correctly, then the obj. mod. issue can also be the reason why new projects get corrupted ??


    ;o)) Henrik
    Bests,
    RD


    PS: Wish there were a knob on the TV to turn up the intelligence. There's a knob called "brightness," but that doesn't work

Posting Permissions

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