I have some problems to find the Cell count of my worksheet.
I use this lines of code to read the content of an existing XLS file.
- Code: Select all
this.workBook = new Spire.Xls.Workbook();
this.workBook.LoadFromFile(path);
Now i have access to the cell Values but i like to go through all cells line by line so i need the "Rows.Count" and the "Cells.Count".
- Code: Select all
for (var i = 1; i < this.workBook.Worksheets[k].Rows.Length; ++i)
The rows count i think is the "Rows.Length" (it's exactly the number of lines i have in my XLS file) but if i use the "Cells.Length"
i get an exception cause the Cells are null.
- Code: Select all
for (var j = 0; j < this.workBook.Worksheets[k].Cells.Length; ++j)
How can i solve this problem?
Thanks
fbsol