title: Excel VBA: Why does event trigger twice?
body: <p>I'm trying to avoid Event loops by disabling Events at crucial points. However, it doesn't always work. For instance, this code for a Combo box:</p>
  
  <pre><code>Private Sub TempComboS_Change()
  Dim e
  e = Application.EnableEvents
  Application.EnableEvents = False
    ' 
  Application.EnableEvents = e
  End Sub
  </code></pre>
  
  <p>The blank line is where the useful code goes; as it stands it obviously doesn't do anything. However, when I run it this way (with the blank line), it reaches "End Sub", then it goes back to the beginning and runs again.  (This would make the useful code run twice).</p>
  
  <p>Why is this happening? </p>
  
  <p>EDIT: To clarify for the folks who've been helping me.</p>
  
  <p>I have a macro that opens the dropdown list of the Combo box, activates it, then ends. It works properly. When I select an item from the open list, the Change event runs. This is the current version of the change event:</p>
  
  <pre><code>Private Sub TempComboS_Change()
  End Sub
  </code></pre>
  
  <p>I put a breakpoint on the Private Sub line. It shows that this Change event runs, then runs again. I suspect that it has been doing this all along, and I noticed it now because I need to add code here.</p>
  
  <p>I have no class modules or userforms. The controls are on a worksheet.</p>
  
  <p>I'm going to try the "Run Once" suggestion, and I'll let you know if it works.</p>
  
  <hr>
  
  <p>I tried the "Run Once" code you suggested. It <em>sort</em> of works, but I seem to have a bigger issue. When I select a drop-down list from a data-validated cell, the TempComboS_Change event triggers -- but not only didn't I touch this combo box, the cell isn't the LinkedCell for the combo box. In other words, it seems to be triggering by actions <strong>unconnected</strong> to the combo box!</p>
  
  <p>Got to find out about that Call Stack thing...</p>