title: VBA Nested On Error GoTo
body: <p>I have VBA code that is supposed to be nested error checking, but it does not. The code is psuedo as below. However, whenever an error occurs within an error (For instance, an error is tripped in the loop, goto SmallError occurs, and an error occurs in SmallError) The second GoTo is not used. The error then breaks the code.</p>
  
  <p>Ex:</p>
  
  <p>Error in Loop</p>
  
  <p>GoTo SmallError</p>
  
  <p>Error in SmallError</p>
  
  <p>Code Breaks (Here code should GoTo FatalError)</p>
  
  <pre><code>Sub DoThings()
      On Error GoTo SmallError
      'Coding Happens
      Do While(conditionhere)
         'Looping things happen
      GoTo LoopResume
  SmallError:
      source = Err.source
      descript = Err.Description
      On Error GoTo Fatal Error
      'Small error processing happens
      Resume LoopResume
  FatalError:
      source = Err.source
      descript = Err. Description
      On Error GoTo ExitError
      'Fatal Error processing happens
  ExitError:
      Exit Sub
  LoopResume:
  count = count + 1 
  Loop
  
  On Error GoTo FatalError
  'Finishing code happens
  End Sub
  </code></pre>