View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ruan[_3_] Ruan[_3_] is offline
external usenet poster
 
Posts: 33
Default Workbook_Open() error

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", _
Structu=True, Windows:=False
End Sub

Thanks
Ruan