Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Frozen Status Bar upon Errors

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default 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.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
frozen Traci Excel Discussion (Misc queries) 1 October 31st 09 05:49 PM
reuest formula for auto update status & status date PERANISH Excel Worksheet Functions 5 June 2nd 08 04:26 PM
frozen panes jmack Excel Discussion (Misc queries) 2 May 11th 07 09:00 AM
Excel Throwing Circular Errors When No Errors Exist MDW Excel Worksheet Functions 1 August 10th 06 02:15 PM
Unresolved Errors in IF Statements - Errors do not show in results Markthepain Excel Worksheet Functions 2 December 3rd 04 08:49 AM


All times are GMT +1. The time now is 04:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"