#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 811
Default 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 *



  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default 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 *



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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 *



.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Wait statement in macro tjfwestcoast Excel Discussion (Misc queries) 1 February 5th 10 08:35 PM
(keys,wait) excel MM Excel Discussion (Misc queries) 1 February 11th 09 04:19 PM
sendkeys(keys,wait) how do I use wait MM Excel Discussion (Misc queries) 1 February 11th 09 03:47 PM
Should I Wait? Chaplain Doug Excel Discussion (Misc queries) 0 February 6th 07 04:58 PM
Problem with WAIT Mike[_46_] Excel Programming 0 August 31st 03 01:27 AM


All times are GMT +1. The time now is 11:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"