Hello,

I have a program that needs to compare the current date and time against a file. The file I'm comparing against is a file that gets written to regularly by an external program and is always open.

I was using the file system object to accomplish this:

Set f1 = fso.GetFile(sitePath)
timedif = DateDiff("n", f1.DateLastModified, curdatetime)

My question is: Is there a better way to do this? I'm suspicious that the timedif function is not returning the correct results. It seems to me that although the file is getting written to, the f1.DateLastModified value is incorrect and older than it should be. This file is always open and being written to like I mentioned before.

Any suggestions on how I can more accurately accomplish this?

Thanks,
Steph!