Re: AutoOpen Macro Not Showing Toolbar

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Jean-Guy Marcil (no-spam_at_leaveme.alone)
Date: 11/25/04


Date: Wed, 24 Nov 2004 23:00:08 -0500

Montana DOJ Help Desk was telling us:
Montana DOJ Help Desk nous racontait que :

> Still, AutoOpen did not display the toolbar when the document was
> opened. Then it suddenly occurred to me that I had made AutoOpen a
> private routine. So I removed "Private" from the above routine, and
> it worked!
>
> I guess that makes sense because AutoOpen would have to be called from
> outside of the module, and since the Private keyword makes a macro
> unavailable from outside of the module, the routine simply wasn't
> getting run.
>

Thanks for the update.
It confirms what I thought, There is basically no difference between an Auto
macro and a Document event macro as far as execution goes.
Thanks for reminding us that this is true only if the Auto macro is public.
I never use Auto macros, so it did not occur to me to check if it was
private or not (even though it was staring me in the face in your original
post.... My bad!). This is why I was puzzled as to why you were having
problems and offered a possibility as the cause.

Yet another reason to use document events. These do not show up in the macro
list when you do ALT-F8 because they are by default private. Of course, if
you remove the Private keyword, they will be listed, but you have no reason
to remove the keyword.

Glad you sorted it out!

-- 
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org


Relevant Pages

  • Re: Event Driven Macro
    ... The special document is based on a separate template that is ... There's no need to assign the EditPaste macro to CTRL+V because ... >> special toolbar button. ... >> MT DOJ Help Desk ...
    (microsoft.public.word.vba.general)
  • Re: How do I refer to a general module?
    ... the macro. ... function name that Purchase Requisitions can't find." ... Or that you put the Private keyword in front of it, or that you put it in ... (no private e-mails, please) ...
    (microsoft.public.access.modulesdaovba)
  • Re: Protect a Macro
    ... You can use the Private keyword with your macro to prevent it from ... Private Sub Macro1() ...
    (microsoft.public.excel.programming)