View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_5_] Jim Thomlinson[_5_] is offline
external usenet poster
 
Posts: 486
Default making toggle button in xl menu

Why not just use the state property of a regular button (msoControlButton).
Thsi will show the button as being either depressed or not... (msoButtonUp or
msoButtonDown)

Application.CommandBars("ToolBarName").Controls("C ontrolName").State =
msoButtonDown

--
HTH...

Jim Thomlinson


"tom taol" wrote:



i need to method making the xl menu button of toggle button type using
macro(vba).
here is the code, it does not working.

Set oMenu = Application.CommandBars(1). _
Controls.Add(Type:=msoControlButtonToggle, Befo=1)
With oMenu
.Caption = "test"
.Style = msoButtonIconAndCaptionBelow
.BeginGroup = True
End With


*** Sent via Developersdex http://www.developersdex.com ***