After months of struggling with different libraries for writing Excel, I must say that I finally returned to Excel Interop, believe it or not.
I tried ClosedXML, EPPlus and SpreadsheetLite with all the problems in learning each library and adapting my code. After a long turnaround, errors that sometimes create Excel that cannot be opened, sometimes have terrible performance problems or memory failures, I decided to try Excel Interop again and was surprised to see that it was faster and no errors for my script.
If you want to try the libraries in the mjb answer, do it, but I recommend that you write your Interop code as best as possible, it may surprise you how quickly in the end if you do it right.
The best option for my case:
Use Excel Interop. Write all the Excel data at once using a 2-dimensional array, then format the rich text of those cells that need it in the second pass.
source share