I need to export the data of a report that can escalate to 300.000 rows to excel.
For a high speed requirement, I used this library to create a csv file. The only problem I am having now, is that the column width is not adapted to the content of the widest cell, it gets cutted until I manually widen the column.
I thought that maybe an option was to convert my csv file to an excel file, but I couldn't find a solution anywere!
One option was using OpenXML, but at least what I know, is that it doesn't work for Excel 2007.
Another option was to work with Interop, but it also has its problems.. when I try to create the Application object, it throws an exception:
"Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied." (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).
And the solutions I found can't be implemented on the client I am working on, for security reasons.
I am running out of options..
Thank you for your help!!!
thanks to the suggestion of @mason I ended up using EPPlus.
Thank you!