Last Update

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

Frank Kabel

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
 
S

Steved

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


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top