Custom menus


Posted by Darin on July 25, 2001 8:24 AM

Hi, I have a question about custom menus. I wrote a macro
a couple years ago in excel 95. I created a custom
menu from which to run it (right next to the file menu).
Whenever I opened the workbook containing the macro, that additional
menu item appeared.
Now, I've written one in excel 97. But now it seems
that the custom menu item I've created for it is ALWAYS
there, even when I don't have the workbook with the macro open.
How can I resolve this? I want the menu to appear only when
the workbook containing the macro is open. And I want it
to go away when I close it. I somehow need the menu linked to the
workbook containing the macro.
Thanks for any help.



Posted by Alix on July 26, 2001 3:39 AM


Hi Darin

Try writing these macros into the workbook;

Sub Auto_Open()

Application.CommandBars("Worksheet Menu Bar").Controls("My Menu").Visible = True

End Sub


Sub Auto_Close()
'
Application.CommandBars("Worksheet Menu Bar").Controls("My Menu").Visible = False

End Sub

Hope this helps
Alix