Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i'm trying to add code to give function to a newly created command button on
the form "frmTimeClock" but, am not quite getting it right... (?) the error occurs at line 7 (57017, event handler is invalid) ---------------------------------------------- 1 Private Sub CommandButton1_Click() 2 Dim StartLineNum As Long 3 Dim mycmd As MSForms.CommandButton 4 Set mycmd = frmTimeClock.Controls.Add("forms.commandbutton.1") 5 mycmd.Caption = mycmd.Name 6 With ActiveWorkbook.VBProject.VBComponents("frmTimeCloc k").CodeModule 7 StartLineNum = .CreateEventProc("click", mycmd.Name) + 1 8 .InsertLines StartLineNum, _ 9 "msgbox""You done it"",vbOKOnly" 10 End With 11 End Sub ------------------------------------------------ thanks (as always) in advance mark |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
workbook_Open event Procedure | Excel Discussion (Misc queries) | |||
workbook_Open event Procedure | Excel Discussion (Misc queries) | |||
Event Procedure Programming | Excel Programming | |||
OnTime event not firing in Workbook_Open event procedure | Excel Programming | |||
Programming a current procedure | Excel Programming |