View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JW[_2_] JW[_2_] is offline
external usenet poster
 
Posts: 638
Default Context Menu Commandbar Question

That is the Cells menubar. You add something to it like:
Dim MenuObject As Object
Set MenuObject = Application.CommandBars("Cell"). _
Controls.Add(Type:=msoControlButton)
With MenuObject
.Caption = "Whatever"
.OnAction="Module1.macroName"
End With
Set MenuObject = Nothing

You could then incorporate code to loop though the menu when the
applicable workbook is closed and remove the button, if you so choose.
Sandusky wrote:
Windows XP Pro SP2
Excel 2003 SP3

When I right click anywhere on a worksheet I get the standard Excel context
menu. What commandbar is this, and how would I add a macro item to it?

TIA!

-gk-