Read Excel

This adds the first worksheet to an ExcelWorksheet variable, creates a loop based on the number of written rows in the excel document, getting the values and adding them to a list (List<string> in the snipped below) with each iteration.

This script will require adding using OfficeOpenXml; to the namespaces section.

ExcelWorksheet document = excelDocument.getWorkSheet(1);
int RowsCount = document.Dimension.End.Row; 

for (int j=1;j<=RowsCount;j++)
{
    string cellValue = document.Cells[j, 1].GetValue<string>();					          List<string>.Add(cellValue);}
    List<string>.Add(cellValue);
}

Last updated

Was this helpful?