You will need to copy this code to ThisWorkbook section of your workbook .
| Private Sub Workbook_Open() Dim Edate As Date Edate = Format("31/08/2009", "DD/MM/YYYY") ' Replace this with the date you want If Date > Edate Then MsgBox ("This worksheet was valid upto " & Format(Edate, "dd-mmm-yyyy") & " and will be closed") ActiveWorkbook.Close End If If Edate - Date < 30 Then MsgBox ("This worksheet expires on " & Format(Edate, "dd-mmm-yyyy") & " You have " & Edate - Date & " Days left ") End If End Sub |
Once the expiry date is crossed, user will get message and workbook will be closed by macro
Once the expiry date in with next thirty days, user will get warning message about expiry date and number of days left.








how do i convert numbers in words in xcel format??? m findin it very difficult...
ReplyDeletecan this run automaticaly once the user trys to open the file or do i have to run the macro?
ReplyDeletecan this run automaticaly once the user trys to open the file or do i have to run the macro?
ReplyDeleteWould the author be able to get back into an expried file, since once it expires it will not open?
ReplyDelete