Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Programatically setting, "Break on Unhandled Errors"

13 views
Skip to first unread message

Rirus

unread,
Nov 5, 2002, 1:14:01 PM11/5/02
to
How can I programatically set the, "Break on Unhandled
Erros" button found under VB editor, Tools, Options,
General tab, Error Trapping section?
I am trying to open a document and run a VBA script
automatically. I can't do this because I need the, "Break
on Unhandled Errors" set.

Any help would be greatly appreciated.

Thanks,

Rirus

Steve Hudson

unread,
Nov 24, 2002, 12:57:11 PM11/24/02
to
G'day "Rirus" <richard...@hp.com>,

I have good news and bad news.

The good news is it can be done.

The bad news is its a BITCH to use.

Here's what you do (info from the VBA Developer's Hadnbook, Ch6
Advanced Class Module Techniques):

The registry key used by that dialog is
HKEY_CURRENT_USER\Software\Microsoft\VBA\6.0\Common

this gets copied into

HKEY_CURRENT_USER\Software\Microsoft\VBA\Microsoft Visual Basic

BreakOnAllErrors & BreakOnServerErrors

You need BOTH of these values to be set to 0 for "break on unhandled
errors".

However, setting these requires a reboot to bring them into play.

So, here's your pseudo-code:

examine the key values.
If not compliant, set, exit and force reboot


"Rirus" <richard...@hp.com> was spinning a yarn that went like
this:

Steve Hudson -- Word Heretic, Sydney, Australia
Freelance teacher, trainer, tutor, writer, developer
Email (down): her...@tdfa.com Blog and FAQs (down): http://blog.tdfa.com
Word MVP FAQs: http://www.mvps.org/word/FAQs/index.html
You agree by writing to me personally that any material can be reused publicly unless you explicitly disclaim it. (For List and blog use.)

0 new messages