ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   wait (https://www.excelbanter.com/excel-programming/282637-wait.html)

Eddie[_4_]

wait
 
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

Rob Bovey

wait
 
"Eddie" wrote in message
...
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 *




No Name

wait
 
Thanks , that is just what I needed
-----Original Message-----
"Eddie" wrote in

message
...
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 *



.


Tom Ogilvy

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

--
Regards,
Tom Ogilvy


wrote in message
...
Thanks , that is just what I needed
-----Original Message-----
"Eddie" wrote in

message
...
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 *



.





All times are GMT +1. The time now is 09:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com