Alex Rivera | Logout

VBA Sleep Doesn't Work

Asked 2010-04-29T13:32:30.660
22

I know I'm doing something wrong here. I'm trying to use the sleep function to delay my code, but I get "Sub or Function not defined" error. Any tips?

Edit
Report

1 Answer

21

Everything I've tried seems to hang the application, including Application.Wait. This seems to work though:

waitTill = Now() + TimeValue("00:15:00")

While Now() < waitTill
    DoEvents
Wend
answered 2012-06-28T20:49:45.767

Your Answer