How to prevent the MS Excel error dialog by errorhandling ?

  • Thread starter Thread starter Oscar
  • Start date Start date
O

Oscar

I am building a MS Excel application which uses a VB ActiveX dll. In order
to handle unexpected errors, I've added 'on error goto errorhandler' both in
the routines in the dll as well as in the subroutines in the Excel VBE.
However in some unpredictable cases MS Excel fires an error by which the
following Excel dialog appears :

An error has appeared in MS Excel and has to be closed. We offer our
apologizes for this unconvenience....and asks for sending the report to MS.
After closing this form, Excel is also closed and the whole thing has to be
started again. Since the problem doesn't occur all the time even after
performing the same steps this must be due to Excel and I am not able to
solve this. I was wondering whether there is a kind of errorhandling or
setting other than I've described above which can trap the Excel error so
that Excel would not be closed automatically.

Oscar
 
Hi Oscar,

No, this is an unhandled application error, and you can't trap it. You'll
have to figure out what bit of code is causing Excel to crash and work
around it. Sometimes adding a few DoEvents statements to the offending bit
of code will take care of issues like this. If you look up the actual error
code on the MS site, you may find bug-related information.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]
 
Back
Top