Menus in an xla

  • Thread starter Thread starter renukalondon
  • Start date Start date
R

renukalondon

Hi,

I have written some modules and some code to create a customised menu
(all in VBA). When I create my xla I can see my modules, but the code
to create the menu does not run unless I go to 'This Workbook' and
manually run the code. When I do this I can see my menu, but when I
click on it the attached macro cannot be found. Please could you tell
me how to get my menu code, within my xla, to run and how to make my
macro visible. Is there some issues with menus within xla's?

Thank you,

r.
 
First of all, the code to create the menu should be run from the add-in's
Thisworkbook's Workbook_Open routine

Private Sub Workbook_Open()
your menu code
End Sub

Then deleted when the add-in is closed.

Private Sub Workbook_BeforeClose(Cancel As Boolean)
delete code
End Sub

Second of all, macros in add-ins will not show up in Tools>Macro>Macros.


Gord Dibben MS Excel MVP
 
Back
Top