title: VBA 400 Error when trying to Delete a Named Range
body: <p>I want to delete all global named ranges in a workbook.
  I have this code:</p>
  
  <pre><code>Dim xName As Name
  For Each xName In Application.ActiveWorkbook.Names
      If InStr(xName.Name, "!") = 0 Then xName.Delete
  Next
  </code></pre>
  
  <p>Even when I change the code to delete ALL named ranges, I still get the same error.</p>
  
  <pre><code>Dim xName As Name
  For Each xName In Application.ActiveWorkbook.Names
      xName.Delete
  Next
  </code></pre>
  
  <p>When I run it, only the first Named Range is deleted and then it throws a 400 error.  It doesn't move on to the next one.</p>
  
  <p>Is there some sort of add-on or setting that I'm missing?  This code seems pretty straight-forward, but I can't get it to work.</p>