In all subs and function you should use a error handler. This error handler catches errors and allow you to show the error and stops the Vba from breaking down.
Private Sub GetValue() On Error GoTo ErrorHandler 'Write your code Exit Sub ErrorHandler: Call UI.ShowError(“Actionpad_Company.GetValue”) End Sub
To avoid errors to even happen it could be a good thing to check for general errors.
If Not oMyObject Is Nothing Then ' Do my magic stuff with the object Else Call Lime.MessageBox("Message to user") End If