Results 1 to 5 of 5
  1. #1
    Silver Lounger
    Join Date
    Jul 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    1,609
    Thanks
    0
    Thanked 1 Time in 1 Post

    AutoMacro Inconsistency (VBA/Word/2007)

    I have two Templates which I distribute to my users' Word Startup folder. One template contains two auto macros (AutoExec.Main and AutoExec.AutoExit). The second contains one auto macro (AutoExec.Main). Recently I have had a number of instances where the auto macros have not fired. I recognize that I have not been diligent in Compiling the projects immediately prior to their last save before distribution. Is it possible that this could have been the culprit? Any other considerations?

    Many thanks in advance.
    Regards
    Don

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

    Re: AutoMacro Inconsistency (VBA/Word/2007)

    I'm not sure that a macro AutoExec.AutoExit will run at all. I'd give the module a general name such as basMacros or something like that, and name the macros (subs) AutoExec and AutoExit.

    Are you sure that the users trust installed templates and add-ins?

  3. #3
    Silver Lounger
    Join Date
    Jul 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    1,609
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: AutoMacro Inconsistency (VBA/Word/2007)

    Thank you for the response Hans

    >> Are you sure that the users trust installed templates and add-ins?
    Yes! Irrespective of the user's emotions, the templates are located in "<UserProfile>Application DataMicrosoftWordSTARTUP", a Trusted location.

    >> I'm not sure that a macro AutoExec.AutoExit will run at all.
    The Word VBA Help file provided the attached excerpt on Auto Macros. I believe that I have complied with the requirements. Are you aware of any errors in this area of the Help file?

    It is unclear to me whether an AutoExit procedure in an installed Add-In could affect an AutoExit procedure in another installed Add-In (cause it not to fire), on exiting the application. Can you provide any guidance.

    F.W.I.W.
    The scheme worked well for several years, then became sporadic. Running Code Cleaner appeared to fix the situation, but only temporarily.
    Attached Images Attached Images
    Regards
    Don

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

    Re: AutoMacro Inconsistency (VBA/Word/2007)

    I suspected that mixing the two methods described in your screenshot might confuse Word, but I performed a test and it doesn't - both AutoExec.Main and AutoExec.AutoExit ran. If I create such code in multiple add-ins, it runs in all of them.

    I tested using Word 2002. I don't have Word 2007. I have no idea why the code doesn't run dependably in Word 2007.

  5. #5
    Silver Lounger
    Join Date
    Jul 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    1,609
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: AutoMacro Inconsistency (VBA/Word/2007)

    Thank you for your support Hans. If I ever get to the bottom of this, I will post the findings.
    Regards
    Don

Posting Permissions

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