• AutoMacro Inconsistency (VBA/Word/2007)

    Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » AutoMacro Inconsistency (VBA/Word/2007)

    Author
    Topic
    #454487

    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.

    Viewing 0 reply threads
    Author
    Replies
    • #1128333

      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?

      • #1128385

        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 “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.

        • #1128387

          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.

          • #1128388

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

    Viewing 0 reply threads
    Reply To: AutoMacro Inconsistency (VBA/Word/2007)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: