Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to refer to an ActiveX Control itself in event handler?
Hello,
In the event handler function for a button, how do I refer to the control itself? I tried "Me" but found out it refers to the active worksheet. I know I can get it by using ActiveSheet.OLEObjects("btn_RESET"), but was wondering if there is an easier way. Private Sub btn_RESET_Click() End Sub Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to refer to an ActiveX Control itself in event handler?
Try this,
'------------------------------- Private Sub btn_RESET_Click() Dim Btn As Object, Message As String Set Btn = Shapes("CommandButton1").OLEFormat.Object.Object Message = "Type of control : " & TypeName(Btn) & vbCrLf & _ "Caption : " & Btn.Caption MsgBox Message End Sub '------------------------------- a écrit dans le message de groupe de discussion : ... Hello, In the event handler function for a button, how do I refer to the control itself? I tried "Me" but found out it refers to the active worksheet. I know I can get it by using ActiveSheet.OLEObjects("btn_RESET"), but was wondering if there is an easier way. Private Sub btn_RESET_Click() End Sub Thanks. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to refer to an ActiveX Control itself in event handler?
Me.btn_RESET.Caption = "kf9150" -- Jim Cone Portland, Oregon USA wrote in message Hello, In the event handler function for a button, how do I refer to the control itself? I tried "Me" but found out it refers to the active worksheet. I know I can get it by using ActiveSheet.OLEObjects("btn_RESET"), but was wondering if there is an easier way. Private Sub btn_RESET_Click() End Sub Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Centralized event handler | Excel Programming | |||
A way refer to a control itself in an event handler | Excel Programming | |||
publish activeX combobox and other activeX control | Excel Programming | |||
Event not shown for an ActiveX control | Excel Programming | |||
Event handler | Excel Programming |