Hello all,
I have code in a workbook that automatically creates a log of who has opened the workbook and the date on a designated worksheet, code below. Is there a way I can modify this so that even if the workbook is opened as read only, the log will still be created? I want to lock modifications with a password in the tools>general options field of the save process but still want the log to generate as different users open the workbook, whether as read only or with the password to allow modifications.
Thank you in advance!
George
I have code in a workbook that automatically creates a log of who has opened the workbook and the date on a designated worksheet, code below. Is there a way I can modify this so that even if the workbook is opened as read only, the log will still be created? I want to lock modifications with a password in the tools>general options field of the save process but still want the log to generate as different users open the workbook, whether as read only or with the password to allow modifications.
Thank you in advance!
George
VBA Code:
Private Sub Workbook_Open()
Dim Lrow As Single
Lrow = Worksheets("Gradebook Log").Range("A" & Rows.Count).End(xlUp).Row + 1
Worksheets("Gradebook Log").Range("A" & Lrow).Value = Now
Worksheets("Gradebook Log").Range("B" & Lrow).Value = Application.UserName
ThisWorkbook.Save
End Sub