c# - Excel worksheet get item -
I have problems with Excel worksheet I am trying to create an Excel file with C #.
This code works and runs properly on my computer, but there is an error in the last line in other computers:
Excel application xlApp; Excel.Workbook xlWorkBook; Excel.Worksheet xlWorkSheetInvoice; Excel.Worksheet xlWorkSheetInvoiceLine; Object Mist Value = System. reflection. missing. Value; XlApp = New Microsoft.Office.Interop.Excel.Application (); XlWorkBook = xlApp.Workbooks.Add (MySQL); XlWorkSheetInvoice = (Excel Worksheet) xlWorkBook.Worksheets.get_Item (1); XlWorkSheetInvoiceLine = (Excel Worksheet) xlWorkBook.Worksheets.get_Item (2);
System. Runtime Interp Services COMException (0x8002000B): Exception from Invalid Index (Office in Microsoft: 0x8002000b (DIP_obaidxx)) Office.interop.excel Sheets.Tet IITM (object index)
This post adds a new Excel Your situation can help to create:
Comments
Post a Comment