setting expiry date for worksheet

muffins

Board Regular
Joined
Jun 18, 2002
Messages
86
Hi everyone,

i want to put an expiry date for my worksheet such that my macros will be disabled once this date is reached.
How do I disable the macros programatically?

in addition, i realised that this method has a draw back as the user may change the system date of the computer to by pass the security. Is there anyway in which i can check for the network server date instead?

many many thanks in advance.
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
I have one tricky suggestion provided that the system date is not changed. First of all, you need to protect your workbook, say Book1, as well as VBA project.
In ThisWorkBook of Book1 enter the following to check the expire date:

Private Sub Workbook_Open()
Const IssueDate As Date = #7/31/2002#
If DateDiff("d", IssueDate, Date) > 90 Then
MsgBox "Permission Denied"
Application.Quit
End If
End Sub

Secondly, another workbook, say Book2, is used to call Book1.
Also in ThisWorkBook of Book2 enter the following

Private Sub Workbook_Open()
Workbooks.Open Filename:="D:PathBook1.xls", Password:="whateveryoulike"
Windows(1).Close
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,272
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top