View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Reset system clock?

And the point of hard-coding the time of day when setting the
system clock would be what?


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"AA2e72E" wrote in message
...
In the ThisWorkbook module, try:

Private Type SYSTEMTIME
wYear As Integer
wMonth As Integer
wDayOfWeek As Integer
wDay As Integer
wHour As Integer
wMinute As Integer
wSecond As Integer
wMilliseconds As Integer
End Type
Private Declare Function SetSystemTime Lib "kernel32"

(lpSystemTime As SYSTEMTIME) As Long
Sub ResetClock()
Dim lpSystemTime As SYSTEMTIME
lpSystemTime.wDayOfWeek = -1
lpSystemTime.wDay = 24
lpSystemTime.wYear = 2004
lpSystemTime.wMonth = 5
lpSystemTime.wHour = 15
lpSystemTime.wMinute = 32
lpSystemTime.wSecond = 0
lpSystemTime.wMilliseconds = 0
SetSystemTime lpSystemTime
End Sub