Results 1 to 7 of 7
  1. #1
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Edinburgh, Midlothian, Scotland
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts

    VBA Compile Problem

    Word97 - Office97 (SR2)

    I have a two part problem (they may be realted?)...


    1) Whenever I try to compile my VBA project within Normal.dot Word crashes with the following error...

    WINWORD caused an invalid page fault in
    module VBA332.DLL at 015f:651b41d3.

    This also happens when I run some of the functions/macros within my Normal.dot project/document.

    I've tried restoring the dll from disk, only to find its an older version and VBA won't initialise.

    Any ideas on how I can repair this dll, or find a replacement, or an another solution?


    2) Normal.dot is standardised throughout our company, so that we can provide a familiar GUI to every user. The only problem is that the normal.dot file is large (just short of 1MB) and it takes time to open on slower machines. Compiling the VBA doesn't appear to make a difference to the file size (and I can't do it at the moment anyway - see above!).

    Is there any way to reduce the file size of normal.dot without removing code and functionality? Are there any third party "compactors" (?) available?

    Any ideas folks?

    Thanks in anticipation...

    Ade

  2. #2
    BAM
    Guest

    Re: VBA Compile Problem

    Hi Ade,

    1.) Typically the specific file referred to in an IPF error message isn't the problem itself. Usually there is an underlying problem, so replacing it seldom fixes the problem.

    See if this article from the MS KB has the solution you are looking for:
    <A target="_blank" HREF=http://support.microsoft.com/support/kb/articles/Q168/3/31.ASP>http://support.microsoft.com/support/kb/ar...s/Q168/3/31.ASP</A>

    2) When you refer to a "standardized" Normal.dot, do you mean that Normal.dot is shared? If so then that can cause several problems.

    This is not what Word was designed to do. Each user should have a copy of Normal.dot on their workstation. In Word look under Tools/Options/File Locations and User Templates should point to a folder on the local drive. Once this is in place, Word will automatically create a Normal.dot.

    The main reasons for this are:
    1) It decreases your chances of spreading viruses (Not everyone should share the same Kleenex! <grin>)
    2) If Word can't find the network for any number of reasons, then it will create a new Normal.dot on the local drive. When there is more than one Normal.dot then this begins to cause additional problems, errors, etc.
    3) Any changes one user makes affects all users. This type of situations can lead to various error messages and can lead to the corruption of Normal.dot
    4) Microsoft does not recommend you do this either. Additional information can be found in this article from the MS KB:

    <A target="_blank" HREF=http://support.microsoft.com/support/kb/articles/Q167/2/84.ASP>http://support.microsoft.com/support/kb/ar...s/Q167/2/84.ASP</A>

    If the reason Normal.dot is setup as shared is because of global AutoText entries, Macros, Styles, etc.. then these should be placed in a separate template and folder on the server and point each users Startup location to that folder. Upon starting the template will be loaded as a Global Add-in (found under Tools/Templates and Add-Ins) and all items will be available to the user and a little more protected than they would be if stored in a shared Normal.dot.
    ~~~~~~~~~~~
    Cheers!

  3. #3
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Edinburgh, Midlothian, Scotland
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA Compile Problem

    Hi there - thanks for responding!

    Re: IPF - I'll have a look at the KB article - thanks, my searches on MSKB had proved fruitless!

    Re: Shared Normal.dot - god no! Wouldn't dream of sharing it on a network amongst 30'odd users!! Will look into transferring macros/VBA to a global add-in though; this should reduce the size of the normal.dot.

    Many thanks,

    Ade

  4. #4
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Edinburgh, Midlothian, Scotland
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA Compile Problem

    Me again!

    The first solution in the KB article didn't work and the second refers to NT platforms (sorry, forgot to say I'm in Win98). However...

    moving all my vba macros to a global template has halved the normal.dot and I can now compile the global template! Guess the normal.dot I was using was just too big for VBA to handle in one go ??

    Do have something further to test your brain with (and anyone else who's out there?)...

    When I exit Word, it sometimes asks if I want to save the global template - I don't want users to be able to change it though. Previously I've made the file read-only and used a VBA procedure to Exit Word and prevent changes to the normal.dot template...

    Sub ExitWord()
    NormalTemplate.Saved = True
    Application.Quit
    End Sub

    This works just fine when a user exits via a toolbar button that runs this macro, and I've added in the line...

    Templates("C:Program FilesMicrosoft OfficeOfficeStartupGlobal_pde.dot").Saved = True

    ...to prevent changes to the loaded global template also.

    However, I've always had the problem that if users exit via the application window "x" button the macro doesn't run and the user gets prompted to save the normal.dot template. This results in numerous copies of normal.dot; which, as you rightly point, out causes all sorts of problems.

    I've tried trapping this event with the AutoExit() macro feature, but it doesn't work...

    Sub AutoExit()
    NormalTemplate.Saved = True
    End Sub

    Any ideas on how to trap the application window "x" button exit event? Otherwise, I'm going to have numerous copies of the global template flying around ?

    Many thanks again,

    Cheers!

    Ade

  5. #5
    Silver Lounger Charles Kenyon's Avatar
    Join Date
    Jan 2001
    Location
    Sun Prairie, Wisconsin, Wisconsin, USA
    Posts
    2,048
    Thanks
    124
    Thanked 119 Times in 116 Posts

    Re: VBA Compile Problem

    See: <A target="_blank" HREF=http://www.addbalance.com/usersguide/templates.htm>Template Basics</A> (www.addbalance.com/usersguide/templates.htm) for more on global templates and Normal.dot.
    Charles Kyle Kenyon
    Madison, Wisconsin

  6. #6
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Edinburgh, Midlothian, Scotland
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA Compile Problem

    Thanks for the pointers - some really useful tips and tricks and I've been at this Word VBS programming thing for a few years now! Thanks.

    I couldn't actually see anything that answered my query about the application close button not triggering AutoExit macros though?

    Did I miss something??

    Thanks again,

    Ade

  7. #7
    Silver Lounger Charles Kenyon's Avatar
    Join Date
    Jan 2001
    Location
    Sun Prairie, Wisconsin, Wisconsin, USA
    Posts
    2,048
    Thanks
    124
    Thanked 119 Times in 116 Posts

    Re: VBA Compile Problem

    No, you didn't miss anything. Since you noted that you were switching to a global template, I thought you might be able to use the info.

    As far as reducing template bloat, Payne consultants had a code cleaner ADD-IN that worked very well. I think it is available as a download from the CompuServe Word newsgroup.

    As far as the x event, don't have a clue. Have you checked the <A target="_blank" HREF=http://www.mvps.org/word/FAQs/index5.html>Word MVP website</A>? They have several pages on using document events. You might want to post this in the VBA lounge here and on the word.vba.general newsgroup at microsoft.
    Charles Kyle Kenyon
    Madison, Wisconsin

Posting Permissions

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