i have that error here's my code.
Anybody can help what's the problem ? thanks godbless.
Private Sub UserForm_Initialize()
Label1.Caption = ActiveWorkbook.Name & " Type the password to open"
End Sub
Private Sub OK_Click()
If Me.Password.Value = "1234" Then
Run "Sheet_visible"
Sheets("TP & EDC").Activate
Unload Me
Else
MsgBox "Wrong Password Please Try Again", vbExclamation, "Workbook Security"
UserForm_Initialize
End If
End Sub
Private Sub Cancel_Click()
ThisWorkbook.Saved = True
Application.ActiveWorkbook.Close
End Sub
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = 0 Then
Cancel = True
MsgBox "The X is disabled, please use the button on the box", vbCritical, "Function Disabled"
End If
End Sub
Bookmarks