I have a basic winforms app that a user can upload an excel file (.xlsx) and I want to read the contents of this file so I am using EPPlus.
The problem is, I am trying to load the contents of a very large excel file, it has 7 tabs, with one tab haveing more then 200k rows, and another tab with 70k. The other 5 total to about 50k.
These file will also only continue to get bigger.(The end goal) Since I want to import the data, read the data, and depending on the rules/data I have, I need to write data back on the excel file and export it.
I am having issues though with EPPlus in achieving the loading of the data.
here is code
var file = new FileInfo(filePath);
using (var package = new ExcelPackage(file))
{
try
{
// Get the work book in the file
ExcelWorkbook workBook = package.Workbook; //Hangs here for about 2 mins
if (workBook != null)
{
if (workBook.Worksheets.Count > 0)
{
// Get the first worksheet
ExcelWorksheet currentWorksheet = workBook.Worksheets.First();
// gets the currentWorksheet but doesn't evaluate anything...
}
}
}
catch (Exception ex)
{
throw ex;
}
}
The code hangs on the package.workbook line for roughly 2 minutes. Then it gets down into the if where it gets the currentWorkSheet, and if I look at the contents of that variable in my watch, nothing is really loaded since it displays:
Function evaluation disabled because a previous function evaluation timed out. You must continue execution to reenable function evaluation.
I looked at this link from EPPlus and it shows the only issue with loading large files is load from top to bottom and left to right, and they are saying more than 5,000. I have way more than though so I am just wondering if this could even be possible with EPPlus?
Additionally, I have did some google searching and most issues are they can't open the large excel files on server where they could locally...
I have also started looking at Open XML SDK and it seems to be better performance wise, but also much more difficult to use code wise.