Featured Post

TNTET 2017 BREAKING NEWS

TNTET 2017 BREAKING NEWS | ஆசிரியர் தகுதித்தேர்வு நடத்த அனைத்து ஏற்பாடுகளும் தயார்...ஓரிரு நாட்களில் முறையான அறிவிப்பு வெளியாகிறது...| விண்ண...

Tuesday, December 10, 2013

How to Set Expiry Date for Excel File

You can set an expiration date for your excel file using Macro option in Ms. Excel and your whole excel file and its confidential data will be deleted after the set time passed.

 Some files on the excel are valid for a short period of time or needed to destroy. For instance, if you are sharing your products list which is valid upto 60 days of your issue, you can set to expire after 60 days, your excel file could still appear in the timeline of your customers who happen to open excel file through password the next day after 60 day and your file will not find because it has expired after 60 days.

You can set and expiration time for your excel file with the help of adding a simple code in macro's visual basic editors and the excel file will self-destruct after time has passed.



To get started, you need to open the excel file which you want to set the expiry date. Now, go to its tool and then go to macro. In macro, click visual basic editor. Now, you see a note pad right side. Add following code in it by copy and paste.

Private Sub Workbook_Open()
If DateDiff("d","8/11/2013",Date) < -1 Then
Application.ActiveWorkbook.Close
End If
End Sub



In my case, I want to expire 60 days after today, you can write any other date. You can change "8/11/2013" as per your requirement for expiry.  After this, you should Password for protecting  the Visual Basic Editor. Following is its screenshot.


No comments: