title: Method 'VBE' of object '_Application' failed
body: <p>One of my clients has issue running the Excel VBA code below. He gets the following error <code>Method 'VBE' of object '_Application' failed</code>, but only once, after he opens the VBE, it starts to work. Also, it was working for him until yesterday.</p>
  
  <p>He is using Excel 2010.</p>
  
  <p>This is the code that throws the error.</p>
  
  <pre><code>For Each f In Application.VBE.ActiveVBProject.VBComponents
      If InStr(1, f.Name, "UserForm") = 1 Then
          Application.VBE.ActiveVBProject.VBComponents.Remove (f)
      End If
  Next f
  </code></pre>