I am trying to create some Excel sheets and then edit them. On Windows 8 it works as expected but when it is ran on Windows 10 it does not work. It breaks at
xlWorkSheetEvt = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(sheetIndex);
I get an COM exception that says there is a Index error(Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX)). I am thinking in Windows 8 Worksheet.get_Item() will create a sheet without the Worksheets.Add() function but Windows 10 does not. I have the code working now for both but am very curious to know exactly what was happening. Thanks!
User contributions licensed under CC BY-SA 3.0