Option
Explicit
Sub
AbwKx_OnAction()
Dim
shpButton
As
Excel.Shape
Dim
objButton
As
Object
On
Error
Resume
Next
Set
shpButton = ActiveSheet.Shapes(Application.Caller)
On
Error
GoTo
0
If
shpButton
Is
Nothing
Then
Exit
Sub
End
If
If
shpButton.Type <> msoFormControl
Then
Exit
Sub
End
If
If
shpButton.FormControlType <> xlButtonControl
Then
Exit
Sub
End
If
Set
objButton = shpButton.OLEFormat.
Object
Select
Case
objButton.Name
Case
"AbwK1"
Case
"AbwK2"
Case
Else
Call
MsgBox(
"Nicht behandelte Schaltfläche."
& vbNewLine _
&
"--> '"
& objButton.Name &
"'"
, _
vbInformation)
End
Select
End
Sub