Results 1 to 6 of 6
  1. #1
    4 Star Lounger
    Join Date
    Mar 2002
    Location
    Sacramento, California, USA
    Posts
    509
    Thanks
    4
    Thanked 1 Time in 1 Post

    Opening a file without running macros (Word 2003)

    Could somebody please remind me how to do this? It seems to be the only way to debug a baffling problem, and I can't find the documentation for it.

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Opening a file without running macros (Word 20

    You can defeat the Auto____ macros by holding the Shift key until the document has launched and settled down. Did you want to block other types of macros as well? In that case it might be easiest to change the Macro Security level, close and restart Word.

  3. #3
    4 Star Lounger
    Join Date
    Mar 2002
    Location
    Sacramento, California, USA
    Posts
    509
    Thanks
    4
    Thanked 1 Time in 1 Post

    Re: Opening a file without running macros (Word 20

    Thanks; that works. There is no need to suppress other macros because this is a debugging situation. Something in the Document_Open macro is making Word crash ("Microsoft Word has encountered an error and must close"), most but not all of the time. I just need to open the document without running the macro so that I can step through it.

    I'm now waiting for the problem to recur so that I have something to debug!

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

    Re: Opening a file without running macros (Word 20

    >"Microsoft Word has encountered an error and must close"
    It may not be a bug in your code.
    My best success at resolving this problem is to reconstruct the template completely:
    1. <LI>Save a new version
      <LI>Run Rob Bovey's VBA Code Clenaer on the new version, (Options: Do NOT delete exported files, save them to a fresh folder).
      <LI>Close the file.
      <LI>Create a new template, save it with a name.
      <LI>Import the exported files (BAS/CLS/FRM etc.) to the new template.
      <LI>Rebuild the toolbar (if any)
      <LI>Reset the project properties (name, help file, protection etc.).
    If I had to bet, I'd bet that the corruption occurred after a change to a graphic element, e.g. a tioolbar or a GUI form.

  5. #5
    4 Star Lounger
    Join Date
    Mar 2002
    Location
    Sacramento, California, USA
    Posts
    509
    Thanks
    4
    Thanked 1 Time in 1 Post

    Re: Opening a file without running macros (Word 20

    I suspect you're right that it's not a bug in my code. I thought that stepping through the code to find the point of failure would give me a clue to the cause (or at any rate, that nothing else would). Your suggestion sounds promising, and when the problem recurs I will try it.

    It's interesting that you mention toolbars, because for about as long as I have had this problem, the application's user-defined toolbars have been disappearing spontaneously. (They disappear when a window is deactivated, then activated again.) I have been living with that problem because I don't have time to fix it, but it never occurred to me that the two problems were connected.

  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: Opening a file without running macros (Word 20

    > the application's user-defined toolbars have been disappearing spontaneously.
    I think that the bug I'm referring to is some form of corruption. I feel that it arises when i have dragged something to/from the toolbar when I maybe shouldn't have - perhaps while a running macro is paused or interrupted.
    There is (to my mind) another bug regarding toolbars whereby the user-defined toolbar for that application persists when I Alt-Tab to the VBE, and if I click on the toolbar, then Alt-Tab back to the VBE, the toolbar stays hidden (as it ought being part of the application).

    Anyway, chances are that stepping through your code will not reveal any flaw on your part, but rebuilding the template (say 15 minutes) will cause the problem to disappear.

    For the time being (grin!)

Posting Permissions

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