Date Last Saved

C

Craig

Does anyone know how to access the "Date Last Saved"
attribute of a file using VB Code? I want to display the
latest date the file was saved in a footer when printed,
not necessarily the current date or file creation date.
Because Excel is designed to change the modified date of a
file when it is opened (the original modify date is held
in memory and restored if you don't save changes), I can't
use the ".DateLastModified attribute. Any suggestions?
 
T

Tom Ogilvy

? Activeworkbook.BuiltinDocumentProperties("Last Save Time").Value
2/4/2003 1:35:46 PM

Note that this value is not maintained in Excel 97.

Regards,
Tom Ogilvy
 
R

Rocky McKinley

Hi Craig,

Here is one way to stamp the date into a worksheet footer when someone saves
the workbook.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
myString = "&""Arial,Italic""&14" & Format(Date, "MMM/DD/YYYY")
Sheets("Sheet1").PageSetup.LeftFooter = myString
End Sub
 
R

Rocky McKinley

Correction,

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
myString = "&""Arial,Italic""&14" & Format(Now, "MMM/DD/YYYY HHHH:MM:SS
")
Sheets("Sheet1").PageSetup.LeftFooter = myString
End Sub
 

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