I have written one script that opens a new Excel file at 6:00 AM in the morning and a second script that saves the file every fifteen minutes throughout the day so the data the employee enters during the day won't be lost due to a power failure (we work in China) or some other user screw up!.
Both scripts works just fine. When MS creates the new file at 6:00 AM the time code on the file is correct with the system clock.
After the first script managed save, the time stamp on the file has changed with the time being three hours ahead of the system clock and and the date being one full day ahead.
I have put the system through many tests with other time related functions (other than MS) and I don't find this problem. Only when the file is saved through MS. Another thing that is interesting, once it is saved by MS with the incorrect time stamp and date stamp, I can use the save command in Excel and the file time stamp and date stamp are still incorrect.
Here is a copy of the save script... very simple.... It auto starts with the Macro's property's time control and ends the same way.
//To Periodically Save Existing Gate Report File
//every 15 minutes.
Code: Select all
Label>Loop
SetFocus>Microsoft Excel -*
Wait>3.0
Press Alt
Send>f
Release Alt
Send>s
Wait>900
Goto>Loop
I hope someone has some idea as to why this is happening.
Thank You!