You cannot get the "modified date" from an Excel workbook.
There is no "modified date" to grab.
When you open a workbook the modified date changes to current.
If you close the workbook with no changes or save, the modified date will
revert to last modified date which is last saved date.
Open Windows Explorer and find a workbook saved before today and note the
modified date,
Now open that workbook and View>Refresh in Windows Explorer.
Date will change to current.
Close the workbook without save and View>Refresh in WE.
Note date changes back to original.
To get last saved date you can use a macro like the following.
Sub printit()
ActiveSheet.PageSetup.RightHeader = "&8Last Saved : " & _
Format(ThisWorkbook.BuiltinDocumentProperties("Last Save Time"), _
"yyyy-mmm-dd hh:mm:ss")
End Sub
Gord Dibben MS Excel MVP
Gord Dibben MS Excel MVP