Windows 8 vs Windows 10 with Microsoft.Office.Interop.Excel

0

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!

c#
exception
asked on Stack Overflow Jul 26, 2016 by David Masi • edited Jul 26, 2016 by Erik Philips

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0