Cell Enumerator Incomplete Iteration in Used Range

Issue Title: Cell Enumerator Incomplete Iteration in Used Range

Product: Aspose.Cells

Version: 21.5.0.0

Description: I am facing an issue with the Cell Enumerator in Aspose.Cells. In my Excel worksheet, Column C has a used range from C1 to C434. However, when I use the Cell Enumerator to iterate through the cells in this column, it only goes up to C223, instead of continuing through to C434. In contrast, the Row Enumerator successfully processes all rows up to 434.

This discrepancy is causing problems in my data processing logic, as I cannot access the full range of cells in Column C.

Expected Behavior: The Cell Enumerator should iterate through all cells from C1 to C434.

Actual Behavior: The Cell Enumerator only processes cells up to C223.

Additional Information:

  • I have attached the relevant Excel file for reference.
  • The Row Enumerator works correctly and processes all rows to 434 without issue.

I am also uploading the file which I am having problem.

I am attaching a sample code with the file in it.

Cell_Range_Loop_Test.zip (151.9 KB)

@harshCIPL22,

Thanks for the sample file and sample app.

I checked your code segment and tested your scenario/case using your sample project and sample file. I think it is expected behavior.

Dim rowsEnumerator As IEnumerator = worksheet.Cells.Rows.GetEnumerator()

Please note, for Row enumerator, it will give you rows items which are initialized (even if a single cell is initialized for the whole row, it will count to Row). For Cell enumerator, it will give you cells which are initialized only for the column. So, it seems the results are OK for the scenario/case.