ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Date Last Saved (https://www.excelbanter.com/excel-programming/275632-date-last-saved.html)

Craig[_6_]

Date Last Saved
 
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?

Tom Ogilvy

Date Last Saved
 
? 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



"Craig" wrote in message
...
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?




Rocky McKinley

Date Last Saved
 
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

--
Regards,
Rocky McKinley


"Craig" wrote in message
...
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?




Rocky McKinley

Date Last Saved
 
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

--
Cheers,
Rocky McKinley


"Rocky McKinley" wrote in message
...
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

--
Regards,
Rocky McKinley


"Craig" wrote in message
...
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?







All times are GMT +1. The time now is 01:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com