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"
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"