title: Self Terminating a Class in VBA
body: <p>I'm writing a class in VBA for Excel. I've a userform that opens and initiates the class and then the class is used to navigate a particular file layout. I've the basics implemented, however I want a simple way of exiting gracefully if someone runs the macro on another type of file.</p>
  
  <p>When the class initialises it looks for particular cells/values and sets those ranges as member variables so, for example, if you run the macro on a blank file it crashes with a type Mismatch error.</p>
  
  <p>I don't want complicated error handling or be constantly checking if every range exists as this macro is only designed to work with this particular layout, I want if it can't find all these ranges it displays a message box saying that the file layout looks wrong and gives the option to continue (and likely crash) or quit. </p>
  
  <p>I've tried calling the Class_Terminate sub, Me.Terminate and Set Me = Nothing. Searching on Google and here doesn't bring up anything I've found useful.</p>