Broken Error (No On Error Functionality)

  • Thread starter Thread starter ronaldnotestine
  • Start date Start date
R

ronaldnotestine

In MS Excel Subs, I cannot turn off error dialogs using 'On Error Resume
Next' or 'On Error Goto label' etc.

It was not always thus. Once, I happily used utility subs that with 'On
Error Resume Next' lines, many from John Walkenbach's book. Then,
suddenly, these macros suddenly rebelled, halting execution at the
first error, and displaying the "index out of range error dialog
window"...the one that lets you click a debug button to go to the code
in the VBE.
I have rewritten all macros to avoid any sort of error handling. But,
it sure would be nice to handle them again.
sample macro:

Sub testErrHandling()
On Error Resume Next
ActiveWorkbook.Sheets("BogusWSName").Activate 'No such worksheet
End Sub

Produces runtime error 9 (If I translate the Japanese correctly) But,
produces no error if run on one of the lab computers at my university.
(Office XP running on Win2000 network, both Japanese version.)

I am running Japanese Office 2003 on Japanese WinXP Pro on an NEC LaVie
C LC900/3 laptop with 512 mb RAM. The condition has persisted through
an upgrade from Office XP(J) to Office 2003(J)

Have I overlooked some simple setting? (I all too oten do overlook the
painfully obvious.) I would be very grateful if anyone is able to share
any ideas on this. Thank you.
 
Hi Ronald,
In MS Excel Subs, I cannot turn off error dialogs using 'On Error Resume
Next' or 'On Error Goto label' etc.

Within the VBE, click on Tools > Options > General and ensure the 'Error
Handling' is set to 'Break on Unhandled Errors'. It sounds like you have
it set to 'Break on all errors'.

Regards

Stephen Bullen
Microsoft MVP - Excel
www.BMSLtd.co.uk
 
In your pc, try getting to the VBE and then
tools|options|General Tab|

There's an "error trapping" section. I bet you have it set for "Break on all
errors".

Mine was set for "break in class module", but I don't recall the factory
default. You may want to match your lab pc settings.
 
Thank you very much, Stephen Bullen and Dave Peterson. I can now handl
errors again. The problem was the overlooked mistaken setting.

I have chosen the middle of the three error trapping options, which i
semething to do with class modules. I do not understand enough of th
nuts and bolts to know if that is the best setting. But, it seems t
allow my programs to work.

Thank you both again very much. I appreciate that you took a moment t
help.

Ron Notestin
 

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

Back
Top