Stop the Debug option from coming up
I have a code which asks the user to input a password before it will continue
with the code. If the password is incorrect it puts up a message box which
informs the user. At this point, I get the microsoft error message which
gives the user the option to debug............ I don't want this to occur.
Is there any way I can stop the microsoft error message from coming up?
My current code looks like:
Dim MyStr1 As String, MyStr2 As String
MyStr2 = ("admin") 'This is the password and it is CASE sensitive
MyStr1 = InputBox("Password Required")
If MyStr1 = MyStr2 Then
ActiveSheet.Unprotect Password:=MyStr1
Else
MsgBox ("Access Denied")
End If
Rest of code.....................
Thanks in advance.
|