P
PerJ
Hi
I have a problem with adding commands, using VBA, to the commandbar that
shows when you right click a cell in Excel.
The code I use:
Private Sub Workbook_Open()
Dim btn As CommandBarControl
Application.CommandBars("Cell").Reset
Set btn = Application.CommandBars("Cell").Controls.Add(msoControlButton)
With btn
.Style = msoButtonCaption
.Caption = "Test"
.OnAction = "action1"
End With
End If
Next i
End Sub
I'm doing this in Excel 2003
After running the code I can se that the Cell commanbar contains the new
item, but when I rigth click a cell, it doesn't show in the menu.
Can anyone help?
I have a problem with adding commands, using VBA, to the commandbar that
shows when you right click a cell in Excel.
The code I use:
Private Sub Workbook_Open()
Dim btn As CommandBarControl
Application.CommandBars("Cell").Reset
Set btn = Application.CommandBars("Cell").Controls.Add(msoControlButton)
With btn
.Style = msoButtonCaption
.Caption = "Test"
.OnAction = "action1"
End With
End If
Next i
End Sub
I'm doing this in Excel 2003
After running the code I can se that the Cell commanbar contains the new
item, but when I rigth click a cell, it doesn't show in the menu.
Can anyone help?