K
Ken Soenen
Why doen't the OnTime Method work after a Form is displayed?
Using XP and Excel 2003
any ideas?
thanks
1. go to Forms Module and Run then click button: it does NOTwork. The
msgbox is not displayed.
2. go to module1 and Run sub works(). Everything works as expected.
Put this code in the Forms Module and put a commandbutton on a form
**************************
Private Sub CommandButton1_Click()
'call sub doesNotWork after 3 seconds
Application.OnTime (Now() + TimeSerial(0, 0, 3)), "doesNotWork"
End Sub
Put this code in Module1
*******************
Sub works()
'call sub worksOK after 3 seconds
Application.OnTime (Now() + TimeSerial(0, 0, 3)), "worksOK"
End Sub
Sub worksOK()
MsgBox "worksOK"
End Sub
Sub doesNotWork()
MsgBox "doesNotWork"
End Sub
Using XP and Excel 2003
any ideas?
thanks
1. go to Forms Module and Run then click button: it does NOTwork. The
msgbox is not displayed.
2. go to module1 and Run sub works(). Everything works as expected.
Put this code in the Forms Module and put a commandbutton on a form
**************************
Private Sub CommandButton1_Click()
'call sub doesNotWork after 3 seconds
Application.OnTime (Now() + TimeSerial(0, 0, 3)), "doesNotWork"
End Sub
Put this code in Module1
*******************
Sub works()
'call sub worksOK after 3 seconds
Application.OnTime (Now() + TimeSerial(0, 0, 3)), "worksOK"
End Sub
Sub worksOK()
MsgBox "worksOK"
End Sub
Sub doesNotWork()
MsgBox "doesNotWork"
End Sub