how to make your excel workbook expire ?

smerdyakov

New Member
Joined
Aug 20, 2017
Messages
3
I am using the below code for making my workbook expire
Text
if Date >#03/08/2017 #Then
ThisWorkbook.Close.False

End if
End sub

There is a downside, ie if we change the system time the workbook will function to normal How to make the workbook expire after a period of time?
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
you could add a to a xlhidden page a value, say 1 in A1 then as part of your code use hat to add the 1 when the date expires, and check the sheet on load for a 1 so that even if the date has been put back, the hidden sheet causes the close, though dsabled VBA will still assist with possible access (Not perfect)
 
Upvote 0
you could add a to a xlhidden page a value, say 1 in A1 then as part of your code use hat to add the 1 when the date expires, and check the sheet on load for a 1 so that even if the date has been put back, the hidden sheet causes the close, though dsabled VBA will still assist with possible access (Not perfect)
Adding to the above, maybe you could also at exit stamp the date in a cell in the hidden sheet. On start up, if system date is less than date in cell, exit with a message that the system date has been altered.
 
Upvote 0
you could add a to a xlhidden page a value, say 1 in A1 then as part of your code use hat to add the 1 when the date expires, and check the sheet on load for a 1 so that even if the date has been put back, the hidden sheet causes the close, though dsabled VBA will still assist with possible access (Not perfect)

any links to look for more details ..
 
Upvote 0
Adding to the above, maybe you could also at exit stamp the date in a cell in the hidden sheet. On start up, if system date is less than date in cell, exit with a message that the system date has been altered.

[FONT=&quot]what if the user always keeps his system date and excel date same.i mean , if they knew tomorow its going to expire then always keeps the clock for that day


[/FONT]

[FONT=&quot][/FONT]
[FONT=&quot]

[/FONT]
 
Upvote 0
haha that's the problem ... you think of a solution and some user will always find a way to circumvent the traps!

What you could do then is to store the date with time. On opening of file, store the date with time into the cell. On exit, add the time elapsed to the date+time that was stored initially. The date+time will then keep moving forward and at some point will switch to the new date.

I'm a novice and just thinking up ideas. A veteran on the site am sure will be able to help you more fruitfully.
 
Upvote 0
most operating systems check dates, you can do all sorts, but if you work for an employer, you normally give them copyright on your work, so adding defeats to your bosses property has to be considered also
 
Upvote 0
Also bear in mind that Excel's security is really not that secure, and can usually be defeated by someone who is knowledgeable enough.
So depending on the strength of Excel's security might be a bit misguided.

Also, bear in mind what mole said. I am not sure what reason you have for wanting to do this, but in many countries, anything that you develop for a company while in their employ is their property. So trying to do something like that to prevent them from using it after you leave could actually be a breach of contract and open you up to litigation.
 
Upvote 0

Forum statistics

Threads
1,215,521
Messages
6,125,307
Members
449,218
Latest member
Excel Master

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