title: Object Variable Not Set when Closing UserForm
body: <p>I'm experiencing the error <code>Object variable or With block variable not set</code> error when a userform (<code>UF_Main</code>) within my Excel 2007 project is unloaded either by clicking the red X or following a <code>Unload Me</code> statement.</p>
  
  <p>I've managed to isolate the error down to the following code which is in a Module:</p>
  
  <pre><code>Public Sub fProgressExit()
  
  intProVol = 0
  intProStep = 0
  Unload UF_Progress
  UF_Main.Show 'This line is causing the error'
  
  End Sub
  </code></pre>
  
  <p>Removing the line prevents the error from occurring.</p>
  
  <p>When the userform <code>UF_Main</code> is unloaded, there's no reference to the procedure above and the userform that the procedure relates to (<code>UF_Progress</code>) is already unloaded.</p>
  
  <p>Why do I receive the error when <code>fProgressExit</code> isn't executed when the userform closes?</p>