title: Excel VBA - Debugger Crashes Excel When Stopping The Program
body: <p>I'm trying to code to be able to do simple math inside a text box (user types in 5/8, .625 comes out). If I hit an error, the debugger comes up telling me the error, and if I hit the End Button, another Excel window pops up saying "Microsoft Excel Has Stopped Working" and excel closes then reopens. This also happens when I put breakpoints in the code and stop the program at the break points, excel just crashes, no warning or explanation. </p>
  
  <p>Here is the few lines of code I was debugging, maybe that will help tell you why, but I have several different modules for this project and I've never had this issue before and I have been able to debug without a problem.</p>
  
  <pre><code>Sub TextboxMath(textbox As MSForms.textbox)
      Dim value As String
  
      value = textbox
  
      For i = 1 To Len(value)
          If Mid(value, i, 1) = "+" Then
          ElseIf Mid(value, i, 1) = "-" Then
          ElseIf Mid(value, i, 1) = "*" Then
          ElseIf Mid(value, i, 1) = "/" Then
          End If
      Next i
  End Sub
  </code></pre>
  
  <p>And Also the Code that runs the subprocedure</p>
  
  <pre><code>Private Sub tbANTShankDiameter_AfterUpdate()
      If obSDIN.value = True Then
          Call TextboxMath(tbANTShankDiameter)
      End If
  End Sub
  </code></pre>
  
  <p>This only ever happens when I'm stopping or resetting the debugger and program after an error. I'd appreciate any suggestions, let me know if I need to provide any more information that could help you give me a better suggestion. Thanks a lot for reading and helping!</p>
  
  <p><strong>Edit:</strong> </p>
  
  <p>I tried transferring all the userforms, code, and data to a new workbook, but I still had no luck, and it crashed. I did notice, however, that it only crashes on the AfterUpdate events I have in the code, not in anything else. It crashes when you stop or reset the debugger on an error, or when I stop the code at breakpoints to test. This is the first time I've ever used those events, and I don't have them anywhere else in my workbook, which is why I never had this problem before. Any new ideas anyone? Thanks again!!</p>
  
  <p>Evan</p>