I have an Excel model published on a website that needs to expire every 3 months and then gets replaced with a new version.
To achieve this I have a constant in my code called "ExpireDate" which I set to the date I want the model to expire.
I also have a Boolean variable called "Expired" which is set as follows when the file is opened.
VB Code:
Expired = (Now >= ExpireDate)
For each Sub in the model I include the following code before the main code is run.
VB Code:
If expired Then
MsgBox "This model has expired, please visting the home page for the latest version"
Exit Sub
End If
This prevents any code from running after the expire date.