Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem getting a msoButtonDown status
'
How can I tell is a button on a menu item is checked? I am using this code If (TG8.State = msoButtonDown) Then bMenuAllWorksheetsOption = True End If however even if the button is not checked, the If statement indicates that it is. tia Private TG1 As CommandBarButton Sub Auto_Open() On Error Resume Next CommandBars(1).Controls("myTools").Delete ' Find the Help Menu Set HelpMenu = CommandBars(1).FindControl(ID:=30010) If HelpMenu Is Nothing Then 'Add the menu to the end Set NewMenu = CommandBars(1).Controls.Add _ (Type:=msoControlPopup, _ temporary:=True) Else 'Add the menu before Help Set NewMenu = CommandBars(1).Controls.Add _ (Type:=msoControlPopup, _ Befo=HelpMenu.Index, _ temporary:=True) End If ' Add a caption for the menu NewMenu.Caption = "&myTools" ' OPTIONS MENU ITEM Set MenuItem = NewMenu.Controls.Add _ (Type:=msoControlPopup) With MenuItem .Caption = "&Options" .BeginGroup = True End With ' OPTIONS MENU ITEM - FIRST SUBMENU ITEM Set Submenuitem = MenuItem.Controls.Add _ (Type:=msoControlButton) With Submenuitem .Caption = "OPTIONS MESSAGES: Show &Range Selected" .OnAction = "MenuSetRangeSelectedOption" End With bMenuActiveWorksheetOption = True Set TG1= MenuItem.Controls("OPTIONS RANGE: Use SELECTED W&orksheet") TG1State = msoButtonDown 'MsgBox "TG7 " & MenuItem.Controls("OPTIONS RANGE: Use SELECTED W&orksheet").ID End Sub Sub CheckButtonAndBooleanStatus() On Error Resume Next If (TG8.State = msoButtonDown) Then bMenuAllWorksheetsOption = True End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Status Bar | Excel Discussion (Misc queries) | |||
reuest formula for auto update status & status date | Excel Worksheet Functions | |||
Status Bar box problem | Excel Worksheet Functions | |||
Tax Status | Excel Worksheet Functions | |||
Status Bar | Excel Programming |