I'm trying to generate excel using c# following is the code snippet for it
Microsoft.Office.Interop.Excel;
.
.
.
foreach (string[] rowContents in lstOutputFileContent)
{
for(int i = 0; i < rowContents.Length; i++)
{
sheet.Cells[currRow, i + 1] = rowContents[i];
}
}
but the problem is when lstOutputFileContent contains say more than 50K line then its taking too long to write (4-5 mins). Is there a better/faster way to write excel in this scenario i.e. I've list of array of string and I want to write this to excel.
I tried using OleDb but in case where first few lines contain less cells then when I try to insert row with extra cell it was giving error.
Any help will be greatly appreciated.