Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Status Bar Steve Excel Discussion (Misc queries) 1 June 9th 09 03:20 PM
reuest formula for auto update status & status date PERANISH Excel Worksheet Functions 5 June 2nd 08 04:26 PM
Status Bar box problem Old Keith Excel Worksheet Functions 4 July 13th 07 10:36 PM
Tax Status charline Excel Worksheet Functions 2 September 8th 06 11:00 PM
Status Bar Tom Ogilvy Excel Programming 0 July 29th 03 02:37 PM


All times are GMT +1. The time now is 05:45 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"