excel-interop

Closing Excel Application Process in C# after Data Access

旧时模样 提交于 2019-11-26 04:18:47
问题 I\'m writing an application in C# that opens an Excel template file for read/write operations. I want to when user closes the application, excel application process has been closed, without saving excel file. See my Task Manager after multiple runs of the app. I use this code to open the excel file : public Excel.Application excelApp = new Excel.Application(); public Excel.Workbook excelBook; excelBook = excelApp.Workbooks.Add(@\"C:/pape.xltx\"); and for data access I use this code : Excel

HRESULT: 0x800A03EC on Worksheet.range

╄→гoц情女王★ 提交于 2019-11-26 00:14:53
问题 I am getting HRESULT: 0x800A03EC on Worksheet.range method. Number of rows are more than 70K. Office 2007. Code: Microsoft.Office.Interop.Excel.Range neededRange = currentWS.Range[cell.Cells[1, 1], cell.Cells[nRowCount, nColumnCount]]; Here my rowcount is more than 65530 . Breaks on this function. I have observed that it breaks only when row count goes more than 65530. 回答1: This problem occurs if you are using a backwards compatible sheet (a .xls) instead of a .xlsx To allow sheets to be