Error handling

J

Joanne

In the number property of the err. object, can someone tell me how I know
what each number means? I would like to do a select case statement with each
error number but I don't know how to find a list of these numbers.

Thanks very much for your help.
 
J

Jezebel

You can create your own list with code like this --

Dim pIndex as long

on error resume next
For pIndex = 1 to ...
err.raise pIndex
debug.print pIndex, err.description
Next

Most numbers return "Application-defined or object-defined error" which
doesn't help you much ...
 
H

Helmut Weber

Hi Jezebel,
You can create your own list with code like this --

I thought so, too.
No way, it seems.
Word tells me: _End, _Debug, _Help
and that's it. Can't get to err.number 2.

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 
T

Tony Jollans

Helmut - I think you've forgotten the

On Error Resume Next

at the beginning
 
H

Helmut Weber

Hi Tony,

I had "Break on All Errors" checked. :-(

By the way, is it possible to set
the error-handling options programmatically?

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 
T

Tony Jollans

I hate saying it's not possible, but I certainly don't know how to do it -
except with SendKeys, I suppose.

If the VBE has the focus ...

SendKeys "%to+{Tab}{Right}{Right}%e~"

ought to set Break on unhandled errors - but it's not for normal human
beings ;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top