aerodoc
10-24-2011, 09:58 PM
The simple code below will prevent the VBA from running after a certain fixed date. But that does not prevent the user from rolling back the date.
Private Sub Workbook_Open()
If Date > "10/25/2011 12:00:00 AM" Then
ActiveWorkbook.Close
Else
ActiveWorkbook.Activate
End If
End Sub
Does anyone have code that would prevent the user from defeating this? I can think of creating a log file that would log each time it has been run. Then check for the oldest date. That way, if the user ever ran the file with an expired date, the roll back would not work.
The other option (which may be difficult) would be to use a web query for time. This could be done in the same way and the dates could be collected to see if there was any roll back.
I am hoping there may be something already out there (or something close) that I can work with?
Private Sub Workbook_Open()
If Date > "10/25/2011 12:00:00 AM" Then
ActiveWorkbook.Close
Else
ActiveWorkbook.Activate
End If
End Sub
Does anyone have code that would prevent the user from defeating this? I can think of creating a log file that would log each time it has been run. Then check for the oldest date. That way, if the user ever ran the file with an expired date, the roll back would not work.
The other option (which may be difficult) would be to use a web query for time. This could be done in the same way and the dates could be collected to see if there was any roll back.
I am hoping there may be something already out there (or something close) that I can work with?