Hi Guys,
I'm having a bad time with this code. This code is activated when my workbook is opened. Userform4 is a :username and password" entry form and Userform3 is a userform splash screen that closes after 5 seconds.When i open the workbook and the correct username and password is entered,the splash screen appears and closes, I get and run-time error 57121 and the line " Sheets("Log Book").Visible = True" is highlighted in my macro.
Any help would be appreciated,
Thanks
I'm having a bad time with this code. This code is activated when my workbook is opened. Userform4 is a :username and password" entry form and Userform3 is a userform splash screen that closes after 5 seconds.When i open the workbook and the correct username and password is entered,the splash screen appears and closes, I get and run-time error 57121 and the line " Sheets("Log Book").Visible = True" is highlighted in my macro.
Any help would be appreciated,
Thanks
Code:
Private Sub Workbook_Open()
UserForm4.Show
UserForm3.Show
Sheets("Log Book").Visible = True
Sheets("Log Book").Select
Sheets("Log Book").Unprotect
EndRow = Sheets("Log Book").Range("A65536").End(xlUp).Row + 1
NextNum = Sheets("Log Book").Range("A" & EndRow - 1).Value + 1
Sheets("Log Book").Range("A" & EndRow).Value = NextNum
Sheets("Log Book").Range("B" & EndRow).Value = Environ("USERNAME")
Sheets("Log Book").Range("C" & EndRow).Value = Application.UserName
Sheets("Log Book").Range("D" & EndRow).Value = Now()
Range("c500").End(xlUp).Select
Sheets("Log Book").Visible = True
Sheets("Config").Visible = True
Sheets("Config").Select
Range("C1").Select
Selection.Copy
Sheets("Log Book").Select
Sheets("Log Book").Range("E500").End(xlUp).Select
ActiveCell.Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Sheets("Config").Visible = False
Sheets("Log Book").Visible = False
Sheets("HomePage").Activate
End Sub
Last edited by a moderator: