Closed Thread
Results 1 to 2 of 2

Name of the defualt shortcut commandbar.

  1. #1
    Harry Tuttle
    Guest

    Name of the defualt shortcut commandbar.

    Hello I am trying to add my macro to the shortcut bar that popups when I
    right click in a worksheet, however I don't know the name of that comand
    bar, so I am unable to do so.

    Does anyone know the name of this command bar, or where I could find
    this info. I've tried google, and the VBA help files to no avail. I
    don't know why this should be so hard to find.

    -Thanks

  2. #2
    Dave Peterson
    Guest

    Re: Name of the defualt shortcut commandbar.

    It's called "Cell" as in:

    Option Explicit
    Sub testme()

    Dim myCtrl As CommandBarControl
    Dim myCB As CommandBar

    Set myCB = Application.CommandBars("Cell")

    Set myCtrl = myCB.Controls.Add(Type:=msoControlButton, temporary:=True)
    With myCtrl
    .BeginGroup = False
    .Caption = "Your Caption Here"
    .OnAction = "'" & ThisWorkbook.Name & "'!YourMacronameHere"
    End With
    End Sub
    Sub yourmacronamehere()
    MsgBox "Hi from here"
    End Sub


    Harry Tuttle wrote:
    >
    > Hello I am trying to add my macro to the shortcut bar that popups when I
    > right click in a worksheet, however I don't know the name of that comand
    > bar, so I am unable to do so.
    >
    > Does anyone know the name of this command bar, or where I could find
    > this info. I've tried google, and the VBA help files to no avail. I
    > don't know why this should be so hard to find.
    >
    > -Thanks


    --

    Dave Peterson

Closed 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