+ Reply to Thread
Results 1 to 2 of 2

making toggle button in xl menu

  1. #1
    tom taol
    Guest

    making toggle button in xl menu



    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, Before:=1)
    With oMenu
    .Caption = "test"
    .Style = msoButtonIconAndCaptionBelow
    .BeginGroup = True
    End With


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

  2. #2
    Jim Thomlinson
    Guest

    RE: 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("ControlName").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, Before:=1)
    > With oMenu
    > .Caption = "test"
    > .Style = msoButtonIconAndCaptionBelow
    > .BeginGroup = True
    > End With
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1