LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default XL-2003 - Class Module - Controls declared "withEvents" don't sink events..

Hello !

Given the following code :

' == clsBtn Class module

Private WithEvents mCmdOk AS MSForms.CommandButton

Public Property Set Ok (cmd AS MSForms.CommandButton)
Set mCmdOk = cmd
End Property

Private Sub mCmdOk_Click()
MsgBox "Ok button clicked"
End Sub

' == User Form
Private objBtn AS clsBtn

Private Sub UserForm_Initialize
Dim objBtn as New clsBtn
Set objBtn.Ok = Me.ExistingCmdBtnOnThisForm
End Sub


When I click on "Me.ExistingCmdBtnOnThisForm", I expect the MsgBox to
pop, but nothing happens.

Any idea why it doesn't work ?
Thanks


 
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
There are no "BeforeCalculate" or "AfterCalculate" events Conan Kelly Excel Discussion (Misc queries) 2 December 7th 07 10:30 PM
CommandBars("Worksheet Menu Bar").Controls("Tools").Enabled = Fals Arturo Excel Programming 3 May 26th 05 05:44 PM
Repost: ListBox Headings - customized! Class Module (warning: long post)" Robots Excel Programming 4 July 19th 04 09:01 AM
Can ActiveX controls be "disabled" and "enabled"? William DeLeo Excel Programming 1 May 7th 04 09:10 PM
What events can be captured in a Class Module? Tom Ogilvy Excel Programming 4 September 8th 03 05:41 AM


All times are GMT +1. The time now is 03:45 PM.

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

About Us

"It's about Microsoft Excel"