Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Error handling


Good afternoon,

I am working on developing something that has multiple modules and
subs... Anyway, I am wondering if anyone can give me ideas on the most
effective way of dealing with errors if they occur while the program is
running. I don't want users to have the program to freeze up on them.
Instead I would like it to i.e. return to the beginning of the program
or even shut down so that the user has to reload.

I don't know how I can manage this without making a reference in every
sub routine. For instance, could I put something in the "This
Workbook" excel object that would handle the error at anytime the
workbook is open.

2nd question, is there any code that would unload any active
userforms?

Thanks in advance for any ideas!
Cheers,
dw


--
toocold
------------------------------------------------------------------------
toocold's Profile: http://www.excelforum.com/member.php...o&userid=31608
View this thread: http://www.excelforum.com/showthread...hreadid=546022

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Error handling

You need to have error handling in every procedure and function. There is no
way around it. What the error handler does in each procedure will be specific
to the error generated. Make sure that your error handler resets all
application level settings such as "Applicaton.displayalerts" ... As a
general rule well written code will rarely if ever invoke the error handler.
That being said good code will handle anything that is thrown at it and deal
with any errors appropriately.
--
HTH...

Jim Thomlinson


"toocold" wrote:


Good afternoon,

I am working on developing something that has multiple modules and
subs... Anyway, I am wondering if anyone can give me ideas on the most
effective way of dealing with errors if they occur while the program is
running. I don't want users to have the program to freeze up on them.
Instead I would like it to i.e. return to the beginning of the program
or even shut down so that the user has to reload.

I don't know how I can manage this without making a reference in every
sub routine. For instance, could I put something in the "This
Workbook" excel object that would handle the error at anytime the
workbook is open.

2nd question, is there any code that would unload any active
userforms?

Thanks in advance for any ideas!
Cheers,
dw


--
toocold
------------------------------------------------------------------------
toocold's Profile: http://www.excelforum.com/member.php...o&userid=31608
View this thread: http://www.excelforum.com/showthread...hreadid=546022


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
Error Handling - On Error GoTo doesn't trap error successfully David Excel Programming 9 February 16th 06 05:59 PM
Error handling with a handling routine ben Excel Programming 0 March 15th 05 03:01 PM
error handling off?? Tom Ogilvy Excel Programming 0 August 19th 04 04:31 PM
error handling jeffP Excel Programming 1 July 3rd 04 06:10 PM
Error Handling bw Excel Programming 3 June 20th 04 06:43 PM


All times are GMT +1. The time now is 04:13 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"