Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Centralized event handler Nayan Excel Programming 1 November 2nd 07 07:25 PM
A way refer to a control itself in an event handler clara Excel Programming 1 May 10th 07 08:59 PM
publish activeX combobox and other activeX control irene c Excel Programming 0 March 19th 07 07:19 AM
Event not shown for an ActiveX control Chris Williamson Excel Programming 0 March 8th 07 04:06 PM
Event handler VBA Noob[_4_] Excel Programming 4 April 26th 06 03:49 PM


All times are GMT +1. The time now is 09:56 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"