|
автор: ?????? (30.11.-1 в 00:00) |
|
| Как в Excele програмно создать своё контекстное меню? | |
|
| |
|
автор: pashulka (30.11.-1 в 00:00) |
|
| Re: Контекстное меню (Excel) Private Sub ContextMenuCreate()
With Application.CommandBars.Add _
(Name:="ContextMenu", Position:=msoBarPopup)
With .Controls
With .Add(Type:=msoControlButton)
.FaceId = 277
.Style = msoButtonIconAndCaption
.Caption = "Добавить ..."
.OnAction = "Macros1"
End With
With .Add(Type:=msoControlButton)
.FaceId = 2112
.Style = msoButtonIconAndCaption
.Caption = "Удалить ..."
.OnAction = "Macros2"
End With
End With
End With
End Sub
Private Sub ContextMenuShow()
Application.CommandBars("ContextMenu").ShowPopup
End Sub
Private Sub Macros1()
MsgBox "Hello World", , ""
End Sub
Private Sub Macros2()
MsgBox "Adieu World", , ""
End Sub | |
|
| |