Louis,
Properly controlling a custom menu is rather complex. You need to set
things up to create the menu when the workbook is Opened or Activated, and
the menu must be destroyed when the workbook is Closed or Deactivated.
If the menu is to be associated only with certain worksheets in the
workbook, you also have to create/destroy the menu when those sheets are
Activated/Deactivated.
When I do it, I just set up a call to an "AddMenu" or a "ResetMenu" routine
so that I only have to write those routines once.
Contact me via eMail (remove spaces) at HelpFrom @ jlathamsite.com and I'll
send you a workbook that has demo code to show how I get it done - you can
examine the code and adapt it to your needs?
> Can someone help me with the "How to" trigger a VBA code to set up a
> menu if a particular workbook is opened?
[quoted text clipped - 11 lines]
>
> Luis
JLatham - 10 Sep 2007 03:14 GMT
I should add that you can find a lot of info, including code examples, here:
http://www.ozgrid.com/VBA/custom-menus.htm
and Microsoft has a boatload of info here:
http://support.microsoft.com/default.aspx?scid=kb;en-us;830502&\1Product=xlw
> Louis,
> Properly controlling a custom menu is rather complex. You need to set
[quoted text clipped - 27 lines]
> >
> > Luis