Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I need to pause my code periodically. When I use Application.Wait or Timer function, the processor usage goes to about 50% all the time the sub is paused, but I need something like WScript.Sleep from VBScript that will pause execution without affecting processor usage. Any help is appreciated. -- urkec |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You can use ontime
Sub Main Your code here Application.OnTime Now() + 0.000694444 , "NextPart" End Sub Sub NextPart Rest of code here End Sub The 0.000694444 = 1 minute "urkec" wrote: Hi, I need to pause my code periodically. When I use Application.Wait or Timer function, the processor usage goes to about 50% all the time the sub is paused, but I need something like WScript.Sleep from VBScript that will pause execution without affecting processor usage. Any help is appreciated. -- urkec |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
There's a Sleep API, too:
Private Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long) Sub testme() sleep 500 'half second end sub urkec wrote: Hi, I need to pause my code periodically. When I use Application.Wait or Timer function, the processor usage goes to about 50% all the time the sub is paused, but I need something like WScript.Sleep from VBScript that will pause execution without affecting processor usage. Any help is appreciated. -- urkec -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks guys
-- urkec "Dave Peterson" wrote: There's a Sleep API, too: Private Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long) Sub testme() sleep 500 'half second end sub urkec wrote: Hi, I need to pause my code periodically. When I use Application.Wait or Timer function, the processor usage goes to about 50% all the time the sub is paused, but I need something like WScript.Sleep from VBScript that will pause execution without affecting processor usage. Any help is appreciated. -- urkec -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
WScript.Shell | Excel Programming | |||
WScript.Echo... VBA Reference? | Excel Programming | |||
using WScript.CreateObject("Wscript.Shell | Excel Programming | |||
Office 2003 not able to run wscript?? | Excel Programming | |||
WScript object not found (???) | Excel Programming |