MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Capturing "Last Modified" date from within a workbook


Posted by Dale Hagopian on May 15, 2001 7:01 AM

Hello again,
would anyone here know how to grab the "Last Modified"
of an opened workbook? I've tried the "GetFileDate"
command, but it wants me to manually point it to a
file. What I would like is a way for an opened
workbook to, in effect, look at itself and return
a "Last Modified" or "Last Created" date.

Any suggestions? Do I need some VB script?
Thanks in advance!!!
-Dale H.


Posted by cpod on May 15, 2001 9:54 AM

You can add this as a User Defined Function:

Public Function ModDate()
ModDate = Format(FileDateTime(ThisWorkbook.FullName), "m/d/yy h:n ampm")
End Function


Posted by Dale H. on May 15, 2001 10:12 AM


Wow! Damn! Works like a charm! Thanks a million CPOD!!