//Getting zennotable
IZennoTable tableTest = project.Tables["Table 1"];
tableTest.Clear();
//Getting Excel-file with input data
FileInfo excelFile = new FileInfo(project.Directory + @"\Data.xlsx");
//Working with Excel-file
using (ExcelPackage exPack = new ExcelPackage(excelFile))
{
//Getting worksheet by its number/position
ExcelWorksheet ws = exPack.Workbook.Worksheets[1];
//Getting worksheet by its name
//ExcelWorksheet ws = exPack.Workbook.Worksheets["Sheet1"];
//Setting start row and start column of data range
int startRow = 1;
int startCol = 1;
//Setting end row and end column of data range
int totalRows = ws.Dimension.End.Row;
int totalCols = ws.Dimension.End.Column;
//Also it possible take row/column by number
//int totalRows = 100;
//Getting data from current sheet of Excel-file to our zennotable
for (int row = startRow; row <= totalRows; row++){
string[] arrRow = new string[totalCols];
for (int col = startCol; col <= totalCols; col++){
if (ws.Cells[row, col].Value==null){
arrRow[col-1] = String.Empty;
}else{
arrRow[col-1] = ws.Cells[row, col].Value.ToString();
}
}
//Current row to our zennotable
tableTest.AddRow(arrRow);
}
}