tags:

views:

40

answers:

1

Is there an Excel Application or Workbook event that fires if code execution is ended from a run-time error?

I use Application.Interactive = False at the beginning of some of my procedures. If the code execution stops before Application.Interactive = True at the end of the procedure, then the user gets locked out of the Excel.

I don't want to use On Error GoTo Error_Handler or On Error Resume Next, because I want the error window to show (for the time being).

I want to add Application.Interactive = True to some event that fires when code execution is stopped, or the code module is reloaded.

Thanks!

+3  A: 

What have you against an error handler?

For example:

Sub DoStuff
On Error GoTo Error_Handler

    ''Do stuff

Exit_Here:
    Application.Interactive = True
    Exit Sub

Error_Handler:
    MsgBox Err.Number & " " & Err.Description
    Resume Exit_Here
End Sub
Remou
I didn't know about the Resume statement. I think that'll do. I'll give it a try. Thanks!
Kuyenda