title: Execute code when form is closed in VBA (Excel 2007)
body: <p>I would like to execute some code when a user closes a form using the x button in the top right corner of the window (I have the form load when the excel spreadsheet is opened, and it hides Excel. I want to exit excel once the form is closed, or at least show excel again so the user may exit it manually)</p>
  
  <p>Looking at the form properties, the Unload property is not present, nor am I able to figure out how to make a function which executes when the form is closed.</p>
  
  <p>Unfortunately, coding this in VB is not an option, it must be VBA.</p>
  
  <p>I'm aware of the code needed to unhide Excel or quit it outright, just not how to tie it to the unload event.</p>