Last saved

  • Thread starter Thread starter igor
  • Start date Start date
I

igor

HI,

How can i put the information about last save into the
cell?

code or a formula does not matter.

Thank you
Igor
 
For Excel 2000 and higher you can use this
Range("a1").Value = ThisWorkbook.BuiltinDocumentProperties("Last Save Time")

Note :
This is not working correct in Excel 97

Read this from Tom Ogilvy

Note that this property is not maintained in xl97. However, if the workbook
is created/used in both xl97 and later versions, then when used in the
later versions and saved the property is maintained but when used in xl97
and saved, the property is not altered. The time it was last saved in the
later version will be retrieved if this property is called. If created and
used exclusively in xl97, calling this property will raise an error. You
can use the beforesave event to update this property in xl97 as a
workaround. Just test the version of excel and if xl97, update the
property.

You can use this then

Best to use the before save event under the Thisworkbook module

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
Cancel As Boolean)
Range("a1").Value = Date
End Sub

right click on the Excel icon next to File in the menubar
Choose view code
Paste this event there
Alt-q to go back to Excel

If you save the file the date will be placed in A1
 
What kind of last save information are you looking for:
perhaps "Last Save Time". Be aware that Excel
has lots of volatile functions like the date and time
that will cause Excel to ask you to save the file, so it
actually becomes more a matter of when you last used the file
than when you actually had changes.

Properties
http://www.mvps.org/dmcritchie/excel/property.htm
 
actually code above helped partially, but i still would like to have a
Excel usermame saved next to the date and time.

Thank you for your help
 
Did you know what you wanted when you first asked the question,
if so the more explicitly you ask the question the closer the answer
will be to what you want. Otherwise you build up by bits and pieces
like everyone else including those of us in the Excel newsgroups <grin>.

Try this
User controlled Save History as an alternative to Highlight Changes (#BeforeSave)
http://www.mvps.org/dmcritchie/excel/highlite.htm#beforesave

More information on Event macros in
http://www.mvps.org/dmcritchie/excel/event.htm
 
Back
Top