expiration date for excel file

KO3933

New Member
Joined
Feb 20, 2019
Messages
1
Can anyone advise if I can give an excel file an expiration date so user can no longer access the data after a predetermined expiration date?
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
How about a workbook open macro, asking for a password, and closing the book if incorrect?

Code needs to go in 'ThisWorkbook'

Code:
Private Sub Workbook_Open()


Dim myval As Variant


If CDate("02/12/2018") < Now() Then
myval = InputBox("Workbook expired, enter password to use")
If myval <> "Password" Then
ThisWorkbook.Close
End If
End If


End Sub
 
Upvote 0
How about a workbook open macro, asking for a password, and closing the book if incorrect?
The only issue with that is if they disable VBA, that code will never run.
I have seen people try to do some things with hiding all the data, and you have to run VBA code to expose it. That being said, Excel security is not that great and can be bypassed.

KO3933,
What is the purpose of doing this? Sometimes if we understand not only what you are trying to do, but why, we may be able to offer other alternatives.
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,771
Members
452,353
Latest member
strainu

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