title: excel interop exception 0x8002000B
body: <p>I have the following code to open a workbook and keep just one sheet:</p>
  <pre><code>//Get a new workbook.
  oWB = app.Workbooks.Add(Missing.Value);
  
  int len = oWB.Sheets.Count;
  
  for (int i = 1; i &lt; len; i++)
  {
      ((Worksheet)oWB.Sheets[i]).Delete();
  }
  
  oSheet = (Microsoft.Office.Interop.Excel.Worksheet)oWB.ActiveSheet;
  </code></pre>
  <p>This code has worked for many years in many client configurations.</p>
  <p>For some reason, I have a customer with excel 2013 (in Hebrew), and on his machine I get the following exception:</p>
  <pre><code>System.Runtime.InteropServices.COMException (0x8002000B): Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX))
     at Microsoft.Office.Interop.Excel.Sheets.get__Default(Object Index)
     at IOSIGHT.Win.ActiveReports.ExcelHelper.StartExcel()
  </code></pre>
  <p>If I understand the situation, it seems that for some reason the workbook was left with no sheets,
  so then call to <code>oWb.ActiveSheet</code> throws an exception.
  Any idea what caused this?</p>
  <p>And yes I saw other posts on the same exception, but my code does not match their scenarios.</p>