title: Process performance counter is disabled, so the requested operation cannot be performed
body: <p>I don't see why this doesn't work. </p>
  
  <p>I have gone into the registry and removed the registry key below and still no joy. The error arises at the For Each Loop. If anyone could help it would be appreciated.
   I am using .net framework 1.1
  HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PerfProc\Performance\Disable performance counters             </p>
  
  <pre><code>If System.IO.File.Exists(path) Then
      System.IO.File.Delete(path)
      ExcelApp.DisplayAlerts = False
      ExcelApp.ActiveWorkbook.SaveAs(path)
      ExcelApp.DisplayAlerts = True
  
      ExcelApp.Quit()
      MessageBox.Show("File Exported to: " &amp; path)
  
      Dim proc As System.Diagnostics.Process
      For Each proc In System.Diagnostics.Process.GetProcessesByName("EXCEL")
          'Debug.Print(Now() &amp; " - Killing process ID " &amp; proc.Id)
          proc.Kill()
      Next
  
  
  
  Else
      'saves the file
      ExcelApp.DisplayAlerts = False
      ExcelApp.ActiveWorkbook.SaveAs(path)
      ExcelApp.DisplayAlerts = True
      ExcelApp.Quit()
  
      Dim proc As System.Diagnostics.Process
      For Each proc In System.Diagnostics.Process.GetProcessesByName("EXCEL")
          'Debug.Print(Now() &amp; " - Killing process ID " &amp; proc.Id)
          proc.Kill()
  </code></pre>