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
Private Sub Workbook_Open()
Dim edate As Date
Dim edate1 As Date
edate = Format("23/08/2013", "DD/MM/YYYY") ' Maximum period
    edate1 = Format("18/08/2013", "DD/MM/YYYY") ' Minimum Period
    If Date > edate Or Date < edate1 Then
        MsgBox ("This file is Expired Please contact www.excelmacroclasses.com @ support@excelmacroclasses.com ")
        ThisWorkbook.Close
    End If
End Sub