Is there a way of finding out when an open Excel workbook (actually an Add_In in this case) was last saved?
I'm trying to check the saved date of the add-in when it opens and compare it with the date in a text file. If the book date is newer, I run some other code, if not I don't.
As far as I can see, the workbook object does not have a property equivalent to "DateLastSaved". So I tried to use the filesystem to get a file object and look at its DateLastModified property.
Unfortunately, this always seems to give me the time the file was last opened, which, given that this code is running in the file after it opens, is always more recent than the date in the text file. DateLastAccessed gives the same result. DateCreated does give me an earlier date, but it does not seem to get updated if the file is saved.
So the question boils down to - Is there a way of finding out the REAL date when a workbook (specifically an Add-In) was actually last SAVED?
Tony
I'm trying to check the saved date of the add-in when it opens and compare it with the date in a text file. If the book date is newer, I run some other code, if not I don't.
As far as I can see, the workbook object does not have a property equivalent to "DateLastSaved". So I tried to use the filesystem to get a file object and look at its DateLastModified property.
Unfortunately, this always seems to give me the time the file was last opened, which, given that this code is running in the file after it opens, is always more recent than the date in the text file. DateLastAccessed gives the same result. DateCreated does give me an earlier date, but it does not seem to get updated if the file is saved.
So the question boils down to - Is there a way of finding out the REAL date when a workbook (specifically an Add-In) was actually last SAVED?
Tony