angeklickten button einer commandbar rausfinden...
01.09.2003 08:23:27
rahel
ich habe eine eigene commandbar mit 12 icons:
Sub creaCommandBar()
Dim symbol As CommandBarControl
Dim myFaceID As Integer
Dim myCaption, myToolTipText, mySubExe As String
Dim i As Integer
On Error Resume Next
Application.CommandBars("Conditions").Delete
With Application
.CommandBars.Add("Conditions", 1, msoBarLeft, True).Visible = True
End With
For i = 1 To 12
Select Case i
Case 1
myCaption = ""
myToolTipText = "einwandfrei"
myFaceID = 59
mySubExe = "PIC_Ins1"
Case 2
myCaption = "MM"
myToolTipText = "mittelmässig"
myFaceID = 0
mySubExe = "PIC_Ins2"
Case 3
myCaption = ""
myToolTipText = "ungenügend"
myFaceID = 276
mySubExe = "PIC_Ins3"
Case 4
myCaption = ""
myToolTipText = "schlecht"
myFaceID = 346
mySubExe = "PIC_Ins4"
Case 5
myCaption = ""
myToolTipText = "unbekannt / fraglich"
myFaceID = 1089
mySubExe = "PIC_Ins5"
Case 6
myCaption = ""
myToolTipText = "funktionsfähig"
myFaceID = 1087
mySubExe = "PIC_Ins6"
Case 7
myCaption = ""
myToolTipText = "idee / lösung"
myFaceID = 351
mySubExe = "PIC_Ins7"
Case 8
myCaption = ""
myToolTipText = "falsch / Vorsicht"
myFaceID = 1019
mySubExe = "PIC_Ins8"
Case 9
myCaption = ""
myToolTipText = "unnütz / löschen"
myFaceID = 67
mySubExe = "PIC_Ins9"
Case 10
myCaption = ""
myToolTipText = "Tendenz steigend"
myFaceID = 38
mySubExe = "PIC_Ins10"
Case 11
myCaption = ""
myToolTipText = "Tendenz beständig"
myFaceID = 39
mySubExe = "PIC_Ins11"
Case 12
myCaption = ""
myToolTipText = "Tendenz fallend"
myFaceID = 40
mySubExe = "PIC_Ins12"
End Select
Set symbol = Application.CommandBars("Conditions").Controls.Add(1)
With symbol
.Style = 3
.Caption = myCaption
.FaceId = myFaceID
.TooltipText = myToolTipText
.OnAction = "PIC_Insert"
.BeginGroup = True
End With
Next i
End Sub
nun habe ich einen
Sub PIC_Insert, der einen Parameter übernehmen soll und mir jenachdem, welchen button ich angeklickt habe, das entsprechende bild in eine bestimmte Zelle einfügt. wie kann ich diese PIC_Insert methode mit Parameter aufrufen?
Gruss, Rahel