I have a Excel version problem with an Windows Forms Tool.
Microsoft.Office.Interop.Excel.Worksheet ws = myExcelWorkbook.Worksheets[3];
ws.Delete();
ws = myExcelWorkbook.Worksheets[3];
This works perfectly with Excel 2010 but throws the following Exception in
Excel 2013: "0x8002000B DISP_E_BADINDEX"
Excel only creates one Worksheet in a new document by default, unlike 3 Worksheets for Excel 2010.
So BADINDEX means you don't have an Index of 3
User contributions licensed under CC BY-SA 3.0