Workbook_Open() error

  • Thread starter Thread starter Ruan
  • Start date Start date
R

Ruan

Hello,

The below code works great, but I have to access the code
to modify the DateValue every now and again. I tried to
create a Named Range (A1) called Expiration_Date, but I
receive an error. What am I doing wrong?

This gives me an error
If Now >= DateValue("Expiration_Date") Then


This works, but I would like to call the date from cell A1
Private Sub Workbook_Open()
ThisWorkbook.Unprotect Password:="1234"
If Now >= DateValue("11/01/2003") Then
Worksheets("Oct").Visible = False
Else
Worksheets("Oct").Visible = True
End If
ThisWorkbook.Protect Password:="1234", _
Structure:=True, Windows:=False
End Sub

Thanks
Ruan
 
Back
Top