title: Why MS Excel crashes and closes during Worksheet_Change Sub procedure?
body: <p>I am having a problem with Excel crashing, when I run VBA code on an excel sheet.<br>
  I'm trying to add the following formula on worksheet change:</p>
  
  <pre><code>Private Sub Worksheet_Change(ByVal Target As Range)
     Worksheets("testpage").Range("A1:A8").Formula = "=B1+C1"
  End Sub
  </code></pre>
  
  <p>When this code is run i get a message saying "<strong>excel has encountered a problem and needs to close</strong>" and excel closes.</p>
  
  <p><a href="https://i.stack.imgur.com/EHO8K.png" rel="noreferrer"><img src="https://i.stack.imgur.com/EHO8K.png" alt="enter image description here"></a></p>
  
  <p>If I run the code in the <code>Worksheet_Activate()</code> procedure, it works fine and doesn't crash</p>
  
  <pre><code>Private Sub Worksheet_Activate()
     Worksheets("testpage").Range("A1:A8").Formula = "=B1+C1"
  End Sub
  </code></pre>
  
  <p>But I really need it to work in the <code>Worksheet_Change()</code> procedure. </p>
  
  <p>Has anyone experienced similar crashes when using the <code>Worksheet_Change()</code> event and can anyone point in the right direction to fix this issue ?</p>