PC Review


Reply
Thread Tools Rate Thread

What can we use as an equivalent to "Sleep()" in vb?

 
 
StargateFan
Guest
Posts: n/a
 
      17th Dec 2007
I searched through the archives and there were a few messages
discussing this but no actual syntax could be found (at least during 2
searches).

Is there any vb equivalent to "Sleep()"?

Thanks. D

 
Reply With Quote
 
 
 
 
RB Smissaert
Guest
Posts: n/a
 
      17th Dec 2007
Use the Sleep API:

Private Declare Sub Sleep Lib "Kernel32" (ByVal dwMilliseconds As Long)

Sub TestingSleep()

Sleep 2000
Cells(1) = 1

End Sub


RBS

"StargateFan" <IDon'tAcceptSpam@IDon'tAcceptSpam.com> wrote in message
news:(E-Mail Removed)...
>I searched through the archives and there were a few messages
> discussing this but no actual syntax could be found (at least during 2
> searches).
>
> Is there any vb equivalent to "Sleep()"?
>
> Thanks. D
>


 
Reply With Quote
 
Equiangular
Guest
Posts: n/a
 
      17th Dec 2007
Do you mean this?

Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long)

Sub test()
Msgbox "Wait for 1 sec"
Sleep 1000
Msgbox "Done"
End Sub

StargateFan wrote:
> I searched through the archives and there were a few messages
> discussing this but no actual syntax could be found (at least during 2
> searches).
>
> Is there any vb equivalent to "Sleep()"?
>
> Thanks. D
>

 
Reply With Quote
 
Bob Phillips
Guest
Posts: n/a
 
      17th Dec 2007
Two ways


Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Sub WaitSeconds()
Sleep 1000 * 3 ' 3 seconds
End Sub


and


Sub WaitFor()
Application.Wait Now + TimeSerial(0, 0, 3) ' 3 seconds
End Sub

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"StargateFan" <IDon'tAcceptSpam@IDon'tAcceptSpam.com> wrote in message
news:(E-Mail Removed)...
>I searched through the archives and there were a few messages
> discussing this but no actual syntax could be found (at least during 2
> searches).
>
> Is there any vb equivalent to "Sleep()"?
>
> Thanks. D
>



 
Reply With Quote
 
StargateFanFromWork
Guest
Posts: n/a
 
      17th Dec 2007

"Bob Phillips" <(E-Mail Removed)> wrote in message
news:ORKP7%(E-Mail Removed)...
> Two ways
>
>
> Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
>
> Sub WaitSeconds()
> Sleep 1000 * 3 ' 3 seconds
> End Sub
>
>
> and
>
>
> Sub WaitFor()
> Application.Wait Now + TimeSerial(0, 0, 3) ' 3 seconds
> End Sub


Thanks to everyone for their responses! D

> --
> ---
> HTH
>
> Bob
>
>
> (there's no email, no snail mail, but somewhere should be gmail in my
> addy)
>
>
>
> "StargateFan" <IDon'tAcceptSpam@IDon'tAcceptSpam.com> wrote in message
> news:(E-Mail Removed)...
>>I searched through the archives and there were a few messages
>> discussing this but no actual syntax could be found (at least during 2
>> searches).
>>
>> Is there any vb equivalent to "Sleep()"?
>>
>> Thanks. D
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the equivalent in O2K vb to "Sleep()"? StargateFan Microsoft Outlook VBA Programming 17 31st Jan 2008 02:18 PM
What can we use as an equivalent to "Sleep()" in vb? StargateFan Microsoft Excel Discussion 3 19th Dec 2007 10:42 AM
Windows XP(Home) "Sleep" & "WakeUp" Keys & HIBERNATE. =?Utf-8?B?RG91Z2xhcy5OIChVSyk=?= Windows XP New Users 2 26th Oct 2007 11:21 AM
Vista "Sleep" and "Hibernate" arent working. =?Utf-8?B?Q2hhZEJlZGluZ2Vy?= Windows Vista Performance 0 5th Feb 2007 08:26 PM
Equivalent to Java's "Thread.Sleep()" and quest. about double buffering Rene Ruppert Microsoft Dot NET Compact Framework 3 19th Feb 2006 02:15 PM


Features
 

Advertising
 

Newsgroups
 


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