Here is one way to do it. This will hide a sheet called Sheet1, you can
repeat this for as many sheets as necessary, but you must allow one sheet to
remain visible, so if necessary leave a blank sheet.
Sheet1 is hidden as the workbook closes, and if macros are enabled then it
is shown as the workbook opens, unless the date in the macro is passed.
I have used the workbook protection to prevent the sheet being copied to
another book.
You can refer to a date in a worksheet instead of the date as entered in the
code, but the user could then change this.
You will need to protect the VBA code to make this fully secure, in the VBA
editor Tools >>> VBAProject Properties, Protection tab, and tick Lock project
for viewing.
The following code needs to go in the ThisWorkbook module.
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If ThisWorkbook.Worksheets("Sheet1").Visible <> xlSheetHidden Then
ThisWorkbook.Unprotect Password:="abc"
ThisWorkbook.Worksheets("Sheet1").Visible = xlSheetHidden
ThisWorkbook.Protect Password:="abc", Structure:=True
ThisWorkbook.Save
End If
End Sub
Private Sub Workbook_Open()
If Date >= DateSerial(2007, 10, 30) Then
MsgBox ("Date passed, new workbook required")
Else
ThisWorkbook.Unprotect Password:="abc"
ThisWorkbook.Worksheets("Sheet1").Visible = xlSheetVisible
ThisWorkbook.Worksheets("Sheet1").Activate
ThisWorkbook.Protect Password:="abc", Structure:=True
ThisWorkbook.Saved = True
End If
End Sub
I hope this helps,
Sean.