Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Wellington, Wellington, New Zealand
    Posts
    378
    Thanks
    1
    Thanked 0 Times in 0 Posts

    AutoExec in addin not firing (Word 2003)

    Hi

    The following AutoExec is in a template in my Startup folder (in a module called "AutoMacros": <pre> Option Explicit
    Dim MyAppClass As New AutoMacros_CM

    Public Sub AutoExec()
    Set MyAppClass.MyApp = Word.Application
    Stop
    Call Application_.OptionsDale
    End Sub
    </pre>



    The place I'm at recently upgraded from Office 97/NT to 2003/XP, and it's stopped working. (When I start Word, it never gets to the Stop statement.) The template is definitely being "added in", as I can access its functionality.

    Any ideas?
    Dale

  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: AutoExec in addin not firing (Word 2003)

    Random thoughts:
    1. <LI>Are you starting Word with the /m (macro) switch? This blocks AutoExec macros.
      <LI>Was Word started by Outlook 2003? Who knows what might happen in that case!
      <LI>Are you unconsciously holding down the Shift key when starting Word?
    That's all that comes to mind.

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Wellington, Wellington, New Zealand
    Posts
    378
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: AutoExec in addin not firing (Word 2003)

    None of the above. And, there's no AutoExec in the normal template.

    Curious. I'll try the same template on a standalone PC tonight and see if it works.

    Thanks
    Dale

  4. #4
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Wellington, Wellington, New Zealand
    Posts
    378
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: AutoExec in addin not firing (Word 2003)

    Hi

    It also fails on a Word2000/98 machine. It used to work, so it looks like there's something wrong with the template. I tried Bill Coan's Word VBA Cleaner, but that didn't help.

    Ah well, when I get time I'll do some more experimenting to isolate the problem.

    Thanks for your help
    Dale

  5. #5
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Wellington, Wellington, New Zealand
    Posts
    378
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: AutoExec in addin not firing (Word 2003)

    Hi

    Consider the following AutoExec:<pre> Public Sub AutoExec()
    Stop
    MsgBox "Success"
    End Sub
    </pre>

    I've experimented putting the Stop command before and after the MsgBox. (Modify, save project and close Word, reopen to see what happens.) If the MsgBox is before the Stop command, it always triggers. If the Stop command is before the MsgBox, then:<UL><LI>Sometimes nothing happens when you open Word.
    <LI>Sometimes the Msgbox triggers (in other words, the Stop command gets ignored).[/list]Very peculiar. I think I'm tired of this. It's working now.

    Thanks
    Dale

Posting Permissions

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