OnTime Method fails when Form displayed???

  • Thread starter Thread starter Ken Soenen
  • Start date Start date
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
 
Works for me.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
It worked fine for me (also using xl2003 and winXP (home)).
 
Sorry guys. After turning my machine back on again this afternoon, it works
now for me also on Excel.
However, it still fails on WORD 2003 with XP and WORD 2000 SR-1 with ME. I'm
writing the application to run on both WORD and Excel. Could have sworn I
tested it several times on Excel. Maybe not. With my memory, I consider
myself lucky to find my car in the parking lot nowadays!

Dave and Bob ; Thanks for your time
ken
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top