Somebody, please help, this is driving me insane! I am trying to set up a workbook that will self-populate the date in H7 (that part I have done), but when that date passes, the workbook will be password locked. In other words, you can change data in today's workbook, tomorrow's, next Tuesday's...but not yesterday's. The file in question is a log for work, in which we document varying work activities and the times they occurred, and each day of the year is a different workbook. This is why I used the =Now() function for the date, to make things simpler. Below is the VBA code that I am using, if that helps any (but it might not help too much, because I'm not an Excel Jedi...yet). Thank you for any help you can give, even if its in the slightest degree.
I also have another Workbook_Open() macro running, which does work, and I keep getting a compile error stating Ambiguous Name Detected: Workbook_Open
Code:
Private Sub Workbook_Open()
If Sheet("Activity Sheet").Range("H7").Value <= Today().Value Then
ActiveWorkbook.Protect Password:="password"
MsgBox "This workbook is locked, please contact your Team Lead."
End If
End Sub