title: How to deal with VBA error inside of a class?
body: <p>I am having a hard time figuring out the right way of handling unexpected errors inside of a custom class. If there is an error in any of my classes it causes a radical failure of the application. I cannot seem to figure out the best method of passing errors back to the calling procedure if the class object has instantiated successfully. </p>
  
  <p>Suppose I try to set the age of someone in my class with <code>Person.age=21</code> and there is an error in the <code>Property Let</code> code. How do I trap an unexpected error and give it back to the calling procedure? Then I want to fail gracefully.</p>
  
  <p>I use MS Access to do a bunch of reports in MS Excel and if my application runs into an unexpected error and fails, it leaves hidden MS Excel workbooks open. I would like to catch these errors and then close everything so nothing is hanging. </p>
  
  <p>I don't t really need specific code so much as I need an idea, thought process, or the correct procedure order.</p>
  
  <p>PS: The majority of my subs, functions, and properties have error handling</p>