wait

E

Eddie

Does anyone know what the syntex is to force a 10 second
wait in a macro ? I am doing a odbc call in excel and
want to give the query a chance to complete before
starting the next one. Thanks
 
R

Rob Bovey

Eddie said:
Does anyone know what the syntex is to force a 10 second
wait in a macro ? I am doing a odbc call in excel and
want to give the query a chance to complete before
starting the next one. Thanks

Hi Eddie,

Here's the general idea:

Sub UseWait()
MsgBox "Start"
Application.Wait Now() + CDate("00:00:10")
MsgBox "End"
End Sub

Wait restarts at a specifically defined time, so you have to add the number
of seconds you want to wait to the current time. Change the argument to
CDate() to modify how long the wait should be.

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *
 
G

Guest

Thanks , that is just what I needed
-----Original Message-----


Hi Eddie,

Here's the general idea:

Sub UseWait()
MsgBox "Start"
Application.Wait Now() + CDate("00:00:10")
MsgBox "End"
End Sub

Wait restarts at a specifically defined time, so you have to add the number
of seconds you want to wait to the current time. Change the argument to
CDate() to modify how long the wait should be.

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *



.
 
T

Tom Ogilvy

Better would be to set the Backgroundquery property to false and the macro
will wait for the query to finish.
 

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

Top