View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
jaf jaf is offline
external usenet poster
 
Posts: 300
Default Reset system clock?

Hi Martin,
If your code is running constantly then Windows may not get enough cycles to
do its housekeeping tasks and the slow running clock is the result.
There is a DoEvents command that you should run to let Windows catch up.
It releases (or stops) your code back to Windows and the code won't continue
until Windows has finished doing its thing.
You CAN run DoEvents to often. Doing so will slow everything down.
Find a spot in your code to run a DoEvents every few minutes. Once a minute
would be fine.




--
John
johnf 202 at hotmail dot com


"Martin" wrote in message
...
| I have a procedure that runs from 07:45 to 17:00. The procedure itself
| appears to be slowing the system clock in that this computer now shows
| system time as 14:39, whereas the computer next to it (and unconnected)
| shows the correct time of 14:44.
|
| I know I can reset the system clock by rebooting, is there any way that
VBA
| can be used to reset the clock within another procedure? Or VB or Windows
| API calls or anything??
|
| Thank you
| Martin
|
|