Hi Chris,
 
> Can you explain this simple phenomenon to me?

Sure. You're not 'clearing' the error.

> Private Sub EditHeader()
> ReDoHeaderEdit:
>   iSelection = 0
>   On Error GoTo reporterror
>   iselection=0
>   iSelection = InputBox("Which line to change?")
> reporterror:
>   If Err = 13 Then MsgBox "Please don't press CANCEL"
>   GoTo ReDoHeaderEdit
> End Sub

This line:
  If Err = 13 Then MsgBox "Please don't press CANCEL"
Is followed by another goto, pushing you back into the inputbox, but
since it never issues a err.clear the error is still there! The code
will persist this error until it is ultimately cleared or the
procedure is finished, whichever comes first. Since there's no way
out of the loop you're stuck. :(

Error Management 101:
  Know the state of the Err object at all times. If you check it,
clear it.

Regards,

Shawn K. Hall
http://12PointDesign.com/
http://ReliableAnswers.com/

'// ========================================================
   "I have never advocated war except as a means of peace."
        -- Ulysses S. Grant





'// =======================================================
    Rules : http://ReliableAnswers.com/List/Rules.asp
    Home  : http://groups.yahoo.com/group/vbHelp/
    =======================================================
    Post  : [email protected]
    Join  : [EMAIL PROTECTED]
    Leave : [EMAIL PROTECTED]
'// =======================================================
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/vbhelp/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to