This code is supposed to make it so that after a certain date (January 1st 2014 in this case) the file will ask for a password and if it is not the correct one it will exit. It seemed to run until i put the input box into the code when i debug it says there is not if associated with the last else.
here is the code
Private Sub Workbook_Open()
If DateDiff("d", Date, #1/1/2014#) < -1 Then
answer = InputBox("You need to contact the xxx branch of yyy to access the most up to date manual.", "Update Required")
If answer = "rob" Then GoTo normalStart
Else
ThisWorkbook.Close Savechanges:=True
End If
Else
GoTo normalStart
End If
normalStart:
With Sheet1
.Unprotect Password:="john"
.Protect Password:="john", UserInterfaceOnly:=True
.EnableOutlining = True
End With
End Sub
If you can tell me whats wrong that would be great. thanks
Bookmarks