krishnaoptif
Board Regular
- Joined
- Sep 17, 2010
- Messages
- 140
Hi guys
i want to enable checkboxes from the custom ribbon only for two sheets and for rest of sheet it should be disabled.
Please check below code which i have written.
<group id="Group2" label="SELECT OTHER VIEW OTPIONS"><checkbox id="Showfew" label="Show Few" getpressed="ShowCodes_getPressed" onaction="ShowCodes_onAction" getenabled="GetEnabled"><checkbox id="ShowOther" label="Show Other" getpressed="ShowAbbreviations_getPressed" onaction="ShowAbbreviations_onAction" getenabled="GetEnabled">This is my VBA Code to disable during workbook opening time. i have also written..
how can i run this GetEnabled public sub procedure on Worksheet_Activate() and Worksheet_Deactivate() events</checkbox></checkbox></group>
i want to enable checkboxes from the custom ribbon only for two sheets and for rest of sheet it should be disabled.
Please check below code which i have written.
<group id="Group2" label="SELECT OTHER VIEW OTPIONS"><checkbox id="Showfew" label="Show Few" getpressed="ShowCodes_getPressed" onaction="ShowCodes_onAction" getenabled="GetEnabled"><checkbox id="ShowOther" label="Show Other" getpressed="ShowAbbreviations_getPressed" onaction="ShowAbbreviations_onAction" getenabled="GetEnabled">This is my VBA Code to disable during workbook opening time. i have also written..
Code:
Public Sub GetEnabled(control As IRibbonControl, ByRef returnedVal)
If ActiveSheet.Name = "ItemCreator" Or ActiveSheet.Name = "ItemUpdator" Then
returnedVal = True
Else
returnedVal = False
End If
End Sub
how can i run this GetEnabled public sub procedure on Worksheet_Activate() and Worksheet_Deactivate() events</checkbox></checkbox></group>
Last edited: