Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sheet1 has a commandbutton. When clicked, a form containing one label, an Ok
button and a Cancel button, loads. I cannot get the buttons to fire the events! In sheet1 I have: Private Sub CommandButton1_Click() Call HandleTheForms End Sub In module1 I have: Private Sub HandleTheForms() Frm_Initial.Show End Sub Behind the form, I have: Private Sub Cb1Ok_Click() MsgBox "Success with Ok_Click" End Sub Private Sub Cb2Cancel_Click() MsgBox "Success with Cancel_Click" Exit Sub End Sub Help, feel like I've forgotten what little I thought I knew. Regards. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Change the Private Sub HandleTheForms() to Public Sub HandleTheForms().
That should work. *** Sent via Developersdex http://www.developersdex.com *** |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Works fine for me, except that the sub in the module needs to be public to
be called from the worksheet using your syntax. -- Vasant "Stuart" wrote in message ... Sheet1 has a commandbutton. When clicked, a form containing one label, an Ok button and a Cancel button, loads. I cannot get the buttons to fire the events! In sheet1 I have: Private Sub CommandButton1_Click() Call HandleTheForms End Sub In module1 I have: Private Sub HandleTheForms() Frm_Initial.Show End Sub Behind the form, I have: Private Sub Cb1Ok_Click() MsgBox "Success with Ok_Click" End Sub Private Sub Cb2Cancel_Click() MsgBox "Success with Cancel_Click" Exit Sub End Sub Help, feel like I've forgotten what little I thought I knew. Regards. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
- By "Behind the Form" you mean within the Frm_Initial code module, don't you? - are you really sure the buttons are called Cb1Ok and Cb2Cancel, and not just cbOK and cbCancel, or any other names? Regards, Sébastien "Stuart" wrote: Sheet1 has a commandbutton. When clicked, a form containing one label, an Ok button and a Cancel button, loads. I cannot get the buttons to fire the events! In sheet1 I have: Private Sub CommandButton1_Click() Call HandleTheForms End Sub In module1 I have: Private Sub HandleTheForms() Frm_Initial.Show End Sub Behind the form, I have: Private Sub Cb1Ok_Click() MsgBox "Success with Ok_Click" End Sub Private Sub Cb2Cancel_Click() MsgBox "Success with Cancel_Click" Exit Sub End Sub Help, feel like I've forgotten what little I thought I knew. Regards. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Drop-down list on simple excel 2003 form using "form" from data me | Excel Discussion (Misc queries) | |||
IF formula-simple question; simple operator | Excel Discussion (Misc queries) | |||
Simple Simple Excel usage question | Excel Discussion (Misc queries) | |||
User Form Interface .... really a simple question! | Excel Programming | |||
Simple form question | Excel Programming |