Alerting user to outdated data


Posted by Dale H. on May 04, 2001 8:01 AM

Hello!
I'm trying to construct an Auto_Open macro that will
compare the date a workbook was last saved to today's
date. If it's more than seven days old, Excel will
tell the user something like "Data older than 7 days,
possibly obolete."
There must me a simple way of capturing the last date
saved and comparing it to Now().
Any suggestions?
Thank you in advance!
-Dale H.



Posted by Gregc on May 04, 2001 9:39 AM

Try this

Private Sub Workbook_Open()

DateUpdated = Sheet1.Range("a1") 'this is the date the worksheet was last changed let me know if you need help with that

DateDif = Now() - DateUpdated

If DateDif > 5 Then
MsgBox "This file is too old"
End If


End Sub