Tom’s Tutorials For Excel: Knowing Any Workbook’s Last Saved Date and Time

You can get the last saved date and time for any workbook whether it is open or closed.

In the following pictures, Book1 is the only workbook open in the Visual Basic Editor’s Project window. In the Immediate window of the VBE, I typed the following line of code and pressed Enter to know the last saved date and time for a closed workbook named YourFileName.xlsm located in the path C:\Your\File\Path\:
? FileDateTime("C:\Your\File\Path\YourFileName.xlsm")

In Step 3, for demonstration purposes in the Immediate window, I preceded that line of code with the then-current date and time.

TTFE026a

TTFE026b

TTFE026c

TTFE026d

Share Button
Posted in Tom's Tutorials for Excel
Tags: ,
2 comments on “Tom’s Tutorials For Excel: Knowing Any Workbook’s Last Saved Date and Time
  1. Numan says:

    Hi Tom,
    Nice tip. but is it possible to know who saved (application.username) the file, any vba command.

    Thanks

    • Tom Urtis says:

      Because the last saved date could be derived while the workbook is closed, you’d need a way to look at the past to know who was in the file (as opposed to looking at the present to know who is in the file). If it were me, I’d have a veryhidden sheet in the file(s) of interest that maintains an ongoing (or could be just the latest) record of usernames. That link (it would look like a paste link formula) could be entered in the immediate window of another workbook to return the person who last saved the file.

Leave a Reply

Your email address will not be published. Required fields are marked *

*