View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
sus1e sus1e is offline
external usenet poster
 
Posts: 9
Default Stop the Debug option from coming up

Thank you very much - Its now working fine.

"Stefi" wrote:

Put an
Exit Sub
or an
Application.Quit
line after MsgBox!

Regards,
Stefi


€žsus1e€ť ezt Ă*rta:

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.