Last Update

  • Thread starter Thread starter Steved
  • Start date Start date
S

Steved

Hello from Steved
In an earlier post the below is what I require but I have
put in a excel 97 worksheet and found it is not working.
Please can you advise as to what is needed for it to work
in excel 97.

Function DocProps(prop As String)
On Error GoTo err_value
DocProps = ActiveWorkbook.BuiltinDocumentProperties
(prop)
Exit Function
err_value:
DocProps = CVErr(xlErrValue)
End Function

Now you can use the following formula in one of your cells:
=DocProps("Last save time")
 
Hi
you may try this alternative (though not tested with Excel 97)

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")

You probably have to set a reference to the FileSystem Object in the
VBE
 
Thankyou.
-----Original Message-----
Hi
you may try this alternative (though not tested with Excel 97)

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")

You probably have to set a reference to the FileSystem Object in the
VBE


--
Regards
Frank Kabel
Frankfurt, Germany


.
 
Back
Top