Daryl Wilson via .NET 247 wrote:
Quote:
I am running a macro via VBA in Excel and I want the macro to pause
for a time period of less than a second (maybe 200ms) in a loop. I
tried using the Application.Wait method, but the minimum wait period
is 1 second. I've been driving myself nuts trying to create a
WScript object in VBA and use the sleep method with no success. Any
advice on how to use WScript.Sleep method, or any other more
appropriate method, would be appreciated. |
The WScript object is built-in to the WSH host EXEs (wscript/cscript.exe)
and is not externally creatable. In VBA you have access to the Win32 API so
you could simply declare and call the Win32 Sleep function. Of course, that
puts the entire thread to sleep so it may not accomplish what you need.
--
Michael Harris
Microsoft MVP Scripting
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Please ask follow-up questions via the original newsgroup thread.