This is probably simple, but I did a board search for Now and the search did not return any results.
I am creating a spreadsheet that I would like to 'retire' after a certain period of time via VBA. I put the following in ThisWorkbook
Private Sub Workbook_Open().....
If Now > 12 / 31 / 2006 Then
Worksheets("FileExpired").Visible = True
Worksheets("Information").Visible = xlSheetVeryHidden
Application.Wait Now + TimeValue("00:00:04")
Application.DisplayAlerts = False
'Is it possible to delete "Information" sheet?
Workbook.save
Application.Quit
Else
Worksheets("Information").Visible = True
Worksheets("FileExpired").Visible = xlSheetVeryHidden
End If
I think my logic is correct, but my coding for the now function is off.
Any help is greatly appreciated...
I am creating a spreadsheet that I would like to 'retire' after a certain period of time via VBA. I put the following in ThisWorkbook
Private Sub Workbook_Open().....
If Now > 12 / 31 / 2006 Then
Worksheets("FileExpired").Visible = True
Worksheets("Information").Visible = xlSheetVeryHidden
Application.Wait Now + TimeValue("00:00:04")
Application.DisplayAlerts = False
'Is it possible to delete "Information" sheet?
Workbook.save
Application.Quit
Else
Worksheets("Information").Visible = True
Worksheets("FileExpired").Visible = xlSheetVeryHidden
End If
I think my logic is correct, but my coding for the now function is off.
Any help is greatly appreciated...