LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Error Handling question

Try changing that to "break on unhandled errors"

In general, it is better to use "Break In Class Module" rather than "Break
On Unhandled Errors". With break in class module, you'll enter debug mode on
the exact line within a class that caused the problem. With break on
unhandled errors, you'll break on the code that called the method of the
class, which is of little use for debugging. Of course, this is irrelevant
if you don't have code in any classes.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)



"Dave Peterson" wrote in message
...
Inside the VBE, try:

Tools|Options|General Tab|Error Trapping Section
What's checked?
I'm guessing "break on all errors"

Try changing that to "break on unhandled errors"

If I did this in a General module:

Option Explicit
Sub testme()

On Error GoTo ErrorHand:
Err.Raise 33
On Error GoTo 0

Exit Sub

ErrorHand:
MsgBox Err.Number
Resume Next
End Sub

I'd get the debug window only if "break on all errors" was checked.


J@Y wrote:

I have this set of code:

On error goto ErrorHand:
code 1...
code 1...
code 1...
On error goto 0

ErrorHand:
code...

Somewhere within the Code 1, there is a type mismatch error, but the
program
doesn't go to ErrorHand, instead it goes debug window. Am I doing
something
wrong?


--

Dave Peterson


 
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 question colofnature[_56_] Excel Programming 0 June 6th 06 05:38 PM
Error handling question sungen99[_115_] Excel Programming 0 June 6th 06 05:30 PM
Error handling question sungen99[_114_] Excel Programming 0 June 6th 06 05:28 PM
Look up error handling question. sungen99[_104_] Excel Programming 4 May 12th 06 04:23 PM
question error handling Pierre via OfficeKB.com[_2_] Excel Programming 3 November 7th 05 09:39 PM


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