I have been trying to get the row number effectively. But it fails where data was cleared and cells were not explicitly deleted.
I guess it is because of the "Used Range".
What I did is using EPPLUS
using (var excel = new ExcelPackage(hpf.InputStream))
{
var ws = excel.Workbook.Worksheets["Sheet1"];
if(ws.Dimension.End.Row > 2003)
{
var result = new JsonResult();
result.Data = "FileLimitExceeded" ;
But it gives me incorrect data. How to get the last count effectively.
I found like
var Lastrow = Cells.Find("*", [A1], , , xlByRows, xlPrevious).Row;
But the namespaces I could not comprehend. Could anyone help me with a complete and correct answer ?