I am trying to use VBA to create an Excel report to display the Last Modified date property value of all of the file paths names read from an input file. This is how I get the LastModified date:
Set fso = CreateObject("Scripting.FileSystemObject")
Set currentFile = fso.GetFile(inputFile)
Sheet.Cells(r, 2).Value = currentFile.DateLastModified '<<<Incorrect value
The value displayed for every file read is the current system time in each case. Windows Explorer shows me the correct Last Modified time. When I debug, I see that the DateLastModified property is in fact the same value the Excel report shows.
Why does the DateLastModified function not appear to work?
Not sure if this is related, but my PC does have the msvbvm60.dll VB runtime on it. Could it be a reguistration issue? I could not set a reference to scrrun.dll from a VB.NET project. I followed the instructions here: to create a new library from the scrrun.dll. It looks like it created a library dll with a different name, Scripting.dll, that I was able to reference. Not sure if any of this is related.