Hello I am trying to have my excel document lock up after a few months with this expiration code below but I'm having a few issues.
First issue the Macro code is incorrect for some reason and i can't figure it out.
Second issue the file lets people decide if they want to use the macros in the file and if they choose not to open the file with the macros then they are able to continue to edit the file even after the expiration date.
Is there a way to be able to do both without going crazy.
Here is my Code:
I have attached a file example if anyone can help me.
Thank you
Justin
First issue the Macro code is incorrect for some reason and i can't figure it out.
Second issue the file lets people decide if they want to use the macros in the file and if they choose not to open the file with the macros then they are able to continue to edit the file even after the expiration date.
Is there a way to be able to do both without going crazy.
Here is my Code:
Code:
Sub Auto_Open()
ExpirationCode
End Sub
Sub ExpirationCode()
Dim ExpirationDate As Date
ExpirationDate = DateSerial(2015, 19, 2)
If Now() >= ExpirationDate Then
MsgBox “Trial Period ended on ” & CStr(ExpirationDate) & “.”
ThisWorkbook.Close savechanges:=False
End If
End Sub
I have attached a file example if anyone can help me.
Thank you
Justin
Attachments
Last edited by a moderator: