Dear All,
How to read xls file, cell by cell until end of row?
private bool readXLS(string filename)
{
bool ret = false;
try
{
ret = true;
Workbook workbook = new Workbook(@filename);
}
catch { }
finally { }
return ret;
}
Hi,
Thanks for the temple file.
I have written a sample code to retrieve data cell by cell in rows for your needs, please refer to it:
e.g
Sample code:
string filePath = @“e:\test2\VA_2014-08-27__ngngflrjvvatfbdjyqajycbldrnxnlsglcknykceviojekssbp…xls”;
Workbook workbook = new Workbook(filePath);
//Get the first worksheet
Worksheet worksheet = workbook.Worksheets[0];
//Loop through all the cells which are initialized.
foreach (Aspose.Cells.Cell cell in worksheet.Cells)
{
Console.WriteLine(“Cell:” + cell.Name + " , Value:" + cell.StringValue);
}
Hope, this helps a bit.
Thank you.