Bug in Excel 2003 while debugging RefEdit control in form

M

Mexage

There is a bug in Excel 2003 when debugging the RefEdit:
1. You can place a breakpoint in RefEdit object events, but they will not be
considered.
2. The default error handler is not working; it sometimes crashes Excel.

Consider the following:

Private Sub RefEdit1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
On Error Goto 0
MsgBox "Before"
MsgBox 0 / 0
MsgBox "After"
End Sub

The code above, if associated to a RefEdit control in a form should stop the
execution of the program and display the "Division by 0" error; instead,
Excel will only display the message "Before".

If you setup a custom error handler, you can catch the error:

Private Sub RefEdit1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
On Error Goto err_handler

MsgBox "Before"
MsgBox 0 / 0
MsgBox "After"
exit sub
err_handler:
MsgBox err.Description
End Sub

displays the error in a message box, but it's very annoying.

:-(

"There are only 10 types of persons: the ones who know binary language, and
those who don't"
 

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