Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macros and Menu Command
I recorded a simple macro and saved it only in a specific workbook. I placed
a menu command on that toolbar. Now every workbook I open has the menu command in it and when I click the menu command that appears in a workbook where it shouldn't, it automatically opens up the worksheet that the macro was originally designed for. How can I save the recorded macro and menu command only in one workbook and be sure that it doesn't appear anywhere else? |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macros and Menu Command
record a macro to add and one to delete the menu item
in the workbook you want it on put the install in on startup and the delete on close "mary" wrote: I recorded a simple macro and saved it only in a specific workbook. I placed a menu command on that toolbar. Now every workbook I open has the menu command in it and when I click the menu command that appears in a workbook where it shouldn't, it automatically opens up the worksheet that the macro was originally designed for. How can I save the recorded macro and menu command only in one workbook and be sure that it doesn't appear anywhere else? |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macros and Menu Command
I also found something else on the web that may be a help:
Custom menu items are going to be available to all Workbooks and Worksheets. This can be an issue when the macro is intended for a specific Worksheet in a specific Workbook. All you need to know to overcome this problem is the name of the Toolbar you have placed your custom menu item on. The Worksheet Menu Bar is a safe bet. Activate the sheet that your macro needs active to run correctly. Right click on the sheet name tab and select View Code and place in the code as shown below: Private Sub Worksheet_Activate() Application.CommandBars("Worksheet Menu Bar").Controls _ ("My Macro").Enabled = True End Sub Private Sub Worksheet_Deactivate() Application.CommandBars("Worksheet Menu Bar").Controls _ ("My Macro").Enabled = False End Sub Simply change the name of My Macro to the name of your menu item. "bj" wrote: record a macro to add and one to delete the menu item in the workbook you want it on put the install in on startup and the delete on close "mary" wrote: I recorded a simple macro and saved it only in a specific workbook. I placed a menu command on that toolbar. Now every workbook I open has the menu command in it and when I click the menu command that appears in a workbook where it shouldn't, it automatically opens up the worksheet that the macro was originally designed for. How can I save the recorded macro and menu command only in one workbook and be sure that it doesn't appear anywhere else? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Replace menu command not working | Excel Discussion (Misc queries) | |||
How disable menu command | Excel Discussion (Misc queries) | |||
Name command in Insert Menu | Excel Discussion (Misc queries) | |||
Create an "on my computer" menu command | Setting up and Configuration of Excel | |||
there is no XML command on my data menu | Excel Worksheet Functions |