display file modify date in cell

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

Is it possible to display a file's date stamp (modified
date) in a cell in Excel? I would like to say something
like "File last modified:" and then either in the same or
an adjacent cell have the date display.

Ideally I would like to read the modified date from an
access file, but as an alternative, I could also use
the .xls file itself. Any suggestions/methods to do this
would be great!
 
Hi Mark
try the following UDF
Public Function last_created(filename As String) As Date
Dim oFS As New Scripting.FileSystemObject
Dim oFL As Scripting.File
Set oFL = oFS.GetFile(filename)
last_created = oFL.DateLastModified
End Function

Use this in a cell like:
=last_created("C:\temp\your_filename")

Frank
 
Thanks very much--this worked perfectly--I had to
register the correct library in VB first, but once I did,
it worked great.

Thanks again,
Mark
 
Hi Mark
thanks for the feedback
Frank said:
Thanks very much--this worked perfectly--I had to
register the correct library in VB first, but once I did,
it worked great.

Thanks again,
Mark
 
Back
Top