ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Trapping errors (https://www.excelbanter.com/excel-programming/419092-trapping-errors.html)

ssemtaf

Trapping errors
 
Hi,
I have a sheet with some controls. If a debug situation occurs I
don't want the user to flung into vba land. A calming MsgBox with some
advice to do something or other would be less traumatic. Does anyone
have some code for this please.

Dave Peterson

Trapping errors
 
Lots of times, you can just turn off error checking, do the thing that may cause
an error, then check for an error, and turn error checking back on.

On error resume next
'some code that could cause an error
if err.number < 0 then
err.clear
msgbox "Don't Panic"
'more code???
end if
on error goto 0




ssemtaf wrote:

Hi,
I have a sheet with some controls. If a debug situation occurs I
don't want the user to flung into vba land. A calming MsgBox with some
advice to do something or other would be less traumatic. Does anyone
have some code for this please.


--

Dave Peterson

Chip Pearson

Trapping errors
 
I have some notes about how to implement error handling at
http://www.cpearson.com/Excel/ErrorHandling.htm

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Mon, 27 Oct 2008 09:51:31 -0700 (PDT), ssemtaf
wrote:

Hi,
I have a sheet with some controls. If a debug situation occurs I
don't want the user to flung into vba land. A calming MsgBox with some
advice to do something or other would be less traumatic. Does anyone
have some code for this please.



All times are GMT +1. The time now is 01:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com