Results 1 to 5 of 5
  1. #1
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Elusive invalid page fault (2000 sp-3/ 98SE)

    <P ID="edit" class=small>(Edited by AlanMiller on 22-Jul-05 23:24. Further info - the problem still does occur when macros are enabled, even using winword /a)</P>I'm having a heck of a problem with Word saving a document under another name (save works; Save as doesn't):

    WINWORD caused an invalid page fault in module VBE6.DLL at 016f:650985f3.

    The document relies on another template, which is referenced in VBA. If I run winword /a it will save OK, but if I run Word normally, even with any or all global templates & add-ins unchecked, I still get the problem. I think the same thing happens with Office 97 on XP (haven't got the details yet).

    Any suggestions appreciated.

    Alan

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

    Re: Elusive invalid page fault (2000 sp-3/ 98SE)

    Does the template contain a Document_BeforeSave event handler?

  3. #3
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Elusive invalid page fault (2000 sp-3/ 98SE)

    Hans

    No, it doesn't, but I'm very glad you mentioned it! Checking the ThisDocument module revealed
    <code>
    Option Explicit
    <font color=448800>'Public doc As Document</font color=448800>

    Private Sub Document_New()
    </code>etc.

    I just commented out the declaration (as shown) because I didn't use it, and Bingo! It now seems happy. Now i'm wondering, of course, how such an innocuous little declaration could cause such a problem.

    cheers
    Alan

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

    Re: Elusive invalid page fault (2000 sp-3/ 98SE)

    As a rule, I never declare Public variables in the ThisDocument module, I always define them in a standard module. (Same for ThisWorkbook in Excel)

    ThisDocument is a rather special module, it's best used only for Document_Close, Document_New and Document_Open code.

  5. #5
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Elusive invalid page fault (2000 sp-3/ 98SE)

    I had intended using it to get a reference to any new document created (Document_New) from the template, but didn't need to in this context. I had problems declaring it in a standard module - I suspect it wasn't "seen" until after Document_New had fired. I still can't fathom how to do this without it. Still...

    > As a rule, I never declare Public variables in the ThisDocument module

    I Now I know why. It's a good object <img src=/S/pun.gif border=0 alt=pun width=22 height=18> lesson.

    Alan

Posting Permissions

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