Friday, September 6, 2013

Setting Up Expiry Date for Workbook

Private Sub Workbook_Open()
    Dim ExpDate As Date
    ExpDate = #8/17/2013 10:00:00 AM#
    
    If Now > ExpDate Then ThisWorkbook.Close
    MsgBox "This workbook will expired at " & Format(ExpDate, "dd mmmm yyyy hh:mm:ss AM/PM")
End Sub

No comments:

Post a Comment