
I am presently using the below code for looping through cells in excel sheet.
I want to change that value (6) based on the number of rows filled in excel sheet. Any body Help me out!!
using (ExcelPackage xlPackage = new ExcelPackage(existingFile))
{
// get the first worksheet in the workbook
ExcelWorksheet worksheet = xlPackage.Workbook.Worksheets[1];
int iCol = 2; // the column to read
// output the data in column 2
for (int iRow = 1; iRow < 6; iRow++)
Console.WriteLine("\tCell({0},{1}).Value={2}", iRow, iCol, worksheet.Cell(iRow, iCol).Value);
// output the formula in row 6
Console.WriteLine("\tCell({0},{1}).Formula={2}", 6, iCol, worksheet.Cell(6, iCol).Formula);
} // the using statement automatically calls Dispose() which closes the package.



I found the solution here
http://excelpackage.codeplex.com/WorkItem/View.aspx?WorkItemId=8663

