![]() |
Trigger Action when Standard Menu Item Selected?
I would like to execute some code when a standard menu items is selected
(like 'Protect Sheet'). Is there a way to trap on a menu item? Or, do I essentially need to customize the standard menu item? |
Trigger Action when Standard Menu Item Selected?
Hi Filibust
You can try this example for 'Protect Sheet' For reset use Mycontrol.OnAction = "" Sub test() Dim Mycontrol As CommandBarControl Set Mycontrol = Application.CommandBars("Worksheet Menu Bar").FindControl _ (ID:=893, Recursive:=True) Mycontrol.OnAction = ThisWorkbook.Name & "!mymacro" End Sub Sub mymacro() MsgBox "Hi" End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "Filibuster" wrote in message ... I would like to execute some code when a standard menu items is selected (like 'Protect Sheet'). Is there a way to trap on a menu item? Or, do I essentially need to customize the standard menu item? |
Trigger Action when Standard Menu Item Selected?
Thanks, Ron - works just as I need - much appreciated...
|
All times are GMT +1. The time now is 02:39 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com