![]() |
.OnAction - Multiple Calls
Hi
I am using .OnAction in floating menubar and I want to know can you have the .OnAction call more then one subroutine? Example With Format .Caption ="Fomat a Sheet" .OnAction ="Format" End With I want to do something like below - that way since everything runs off this menubar I can keep the code more compact by putting in calls to Unlock and Lock before and after I do something to a sheet such as my format example I have tried a few different ways and have been unsuccessfull Example With Format .Caption ="Fomat a Sheet" .OnAction ="UnlockSht" "Format" "LockSht" End With |
.OnAction - Multiple Calls
Hi Matt,
Those calls should go inside your Format procedure, not in the OnAction property, e.g.: Sub Format() UnlockSht ''' The rest of your Format procedure code here. LockSht End Sub -- Rob Bovey, MCSE, MCSD, Excel MVP Application Professionals http://www.appspro.com/ * Please post all replies to this newsgroup * * I delete all unsolicited e-mail responses * "Matt" wrote in message om... Hi I am using .OnAction in floating menubar and I want to know can you have the .OnAction call more then one subroutine? Example With Format .Caption ="Fomat a Sheet" .OnAction ="Format" End With I want to do something like below - that way since everything runs off this menubar I can keep the code more compact by putting in calls to Unlock and Lock before and after I do something to a sheet such as my format example I have tried a few different ways and have been unsuccessfull Example With Format .Caption ="Fomat a Sheet" .OnAction ="UnlockSht" "Format" "LockSht" End With |
.OnAction - Multiple Calls
Matt,
OnAction can call only a single procedure. The work-around is to call a procedure that calls the other three. E.g., Sub DoAllThree() UnlockSht Format LockSht End Sub Assign DoAllThree to the menu item. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Matt" wrote in message om... Hi I am using .OnAction in floating menubar and I want to know can you have the .OnAction call more then one subroutine? Example With Format .Caption ="Fomat a Sheet" .OnAction ="Format" End With I want to do something like below - that way since everything runs off this menubar I can keep the code more compact by putting in calls to Unlock and Lock before and after I do something to a sheet such as my format example I have tried a few different ways and have been unsuccessfull Example With Format .Caption ="Fomat a Sheet" .OnAction ="UnlockSht" "Format" "LockSht" End With |
All times are GMT +1. The time now is 02:43 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com