Private Sub Button_Click
On Error Goto err_Button_Click
code
...
exit_Button_Click:
Exit Sub
err_Button_Click:
Msgbox Err.Description
Resume exit_Button_Click
End Sub
after the err_whatever: tag, you can set up code to compare the Err.Code and handle whatever errors you expect.