DateLastModifed and Open File

  • Thread starter Thread starter Joseph Lam
  • Start date Start date
J

Joseph Lam

I'm trying to automatically format my report footers with
certain information, one of the items being the last date
of modification or save date. This is done on the fly
using the workbookbeforeprint event. The only problem is
that after opening a file the lastmodified date becomes
the current date until you close the file without saving,
at which time it reverts back to the true value. Is there
a place where the true lastmodified date is kept while the
file is open? If not, is there a workaround other than
copying the file upon opening and querying the copy which
is closed?

Thanks!
 
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.
 
Back
Top