I am creating a simple code that will check to see if my local excel document matches the document on another network drive.
Everyday, I edit a spreadsheet. Then I save my sheet and right click drag it to the other location and select copy here.
When I run the following code, the FileTime> data for the network drive retrieved is always 2 seconds BEFORE the original file.
The network file = the copy = 2 seconds earlier filetime>
the local = the original = normal filetime>
[code]
goSub>subVarDeclare
FileDate>%PB_ExcelFilePath%,curDate
FileTime>%PB_ExcelFilePath%,curTime
FileDate>%Nuke_PB_ExcelFilePath%,preNukeDate
FileTime>%Nuke_PB_ExcelFilePath%,preNukeTime
MDL>%curDate% %curTime% %preNukeDate% %preNukeTime%
//subVarDeclare--------------------------------------subVarDeclare
SRT>subVarDeclare
Let>Nuke_PB_ExcelFilePath=...networkpath...
Let>PB_ExcelFilePath=...localpath...
End>subVarDeclare
[/code]
OUTPUT
[code]
20080717 163144 20080717 163142
[/code]
Why is it doing that?
FileTime> and copyied file is wrong
Moderators: JRL, Dorian (MJT support)
I experimented with this thinking that perhaps there was a small difference between the time on your server and the time on your computer. In that condition if a file is "created" on each location, for example using WriteLn>, the two file times will match the time on the computer on which the file was created. But when I "copy" a file from one computer to the other, the time always remains exactly the same. My PC is Win XP. I tested with 3 servers, Win 2000, Win 2003, and Red Hat Linux using SMB.
The error is intermittent I have corrected it by allowing for a 2 second gap. I find it very odd that when I drag the original file over to a network drive, the copied version writes itself as having been modified 2 seconds earlier than the original file...according to macro scheduler.
Thank you for testing it out.
Thank you for testing it out.