ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Can the Application.wait method create a pause less than a second? (https://www.excelbanter.com/excel-programming/418029-can-application-wait-method-create-pause-less-than-second.html)

Gum

Can the Application.wait method create a pause less than a second?
 
I have often read that the application.wait method of introducing a pause in
a thread is limited to a second or multiples thereof. Is this true? If it
is true, then is there an alternative. If not, then how is the familiar
'timevalue()' written so that it accesses values that represent a part of a
second.

Mike H

Can the Application.wait method create a pause less than a second?
 
Hi,

I don't believe application.wait can discriminate less than 1 second but
maybe this

Sub SlowDown()
Dim x As Single
x = Timer
While Timer - x < 0.5
Wend
End Sub

Mike

"Gum" wrote:

I have often read that the application.wait method of introducing a pause in
a thread is limited to a second or multiples thereof. Is this true? If it
is true, then is there an alternative. If not, then how is the familiar
'timevalue()' written so that it accesses values that represent a part of a
second.


Jon Peltier

Can the Application.wait method create a pause less than a second?
 
And if you stick a DoEvents between While and Wend, you won't completely
freeze up the machine while waiting.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Mike H" wrote in message
...
Hi,

I don't believe application.wait can discriminate less than 1 second but
maybe this

Sub SlowDown()
Dim x As Single
x = Timer
While Timer - x < 0.5
Wend
End Sub

Mike

"Gum" wrote:

I have often read that the application.wait method of introducing a pause
in
a thread is limited to a second or multiples thereof. Is this true? If
it
is true, then is there an alternative. If not, then how is the familiar
'timevalue()' written so that it accesses values that represent a part of
a
second.





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

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