简体   繁体   中英

Opening a huge .csv file with Excel Interop

I have an application that write huge .csv files about the size ranging from 1 GB to 2 GB.

I need to color code the file and save it as .xlsx.

So I have tried using Excel Interop and it works great for small files, but when I try to open a 1.3 GB .csv file with Excel, I get an Hresult error.

Any ideas as to how I could accomplish this task either with using Excel, or if there is any other way of doing it.

Are you exceeding 1M rows ? Maybe thats the reason for the HRESULT error.

64K rows max before Excel 2007. 1M rows for 2007

There are ways to write and read excel files without using the excel interop. I'm pretty sure I remember microsoft themself have open specifications on the excel fileformat.

感谢您的反馈,在考虑之后,我决定只使用.csv文件。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM