Frozen Status Bar upon Errors
You can set a "general error handler" in your main sub and if there is no
error handler set at a given point of execution, error handling will fall
through to it:
Sub Main()
On Error GoTo GeneralHandler
Call Sub1
Exit Sub
GeneralHandler:
MsgBox "in general error handler"
End Sub
Sub Sub1()
Dim x As Integer
Call Sub2
x = "abc" 'will be caught in Main error handler
End Sub
Sub Sub2()
Dim x As Integer
On Error GoTo Sub3Handler
x = "abc"
Exit Sub
Sub3Handler:
MsgBox "in sub3 handler"
End Sub
--
Jim Rech
Excel MVP
"ExcelMonkey" wrote in message
...
|I have a procedure that uses the
|
| Application.StatusBar to update the user on the progress
| of the routine. As the procedure does not have all the
| error handling that it needs, the procedure is failing
| every now and then. When it fails, the status bar freezes
| with the last value that was in it.
|
| Is there a way to say in the event of any type of error
| clear the status bar. I am assuming it would look like
|
| On Error
| Application.StatusBar = ""
|
| But I am not sure where to put this in my code as I have a
| for Each Loop that calls various procedures. I need to
| put it in part of the code that will always ensure that I
| do not have values in my status bar upon error generation.
|