We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Cells griddesktop startRow < 0 and crash when selecting/scrolling wildly

I experiences the following behavior with aspose.cells.griddesktop:

I load an excel sheet (gridDesktop.ImportExcelFile(fileName, false);) that is visually larger than the griddesktop-Window.

Then using the mouse, I select a cell area but moving the cursor (while right mouse button is down) wildly out of the window to provoke scrolling, and back.

Afterwards I access gridDesktop.GetActiveWorksheet().GetLastSelection();

The returned range contains a StartRow < 0 and an EndRow < 0 (most frequently -2).

Sometimes the Grid crashes the whole application during the wild selection/scrolling.

Can you provide a fix?

Best regards
Christian Bauer


Thanks for your reporting.

Please provide some screenshots explaining the problem. You can create them in Ms-Paint.

Please also download and try the latest version:
for GridDesktop v2.7.4.2001

and see if it works fine.

If you are using any specific code in replicating this problem, please also provide that.

Dear Shakeel!

Please see the attached video showing the behavior.

Best regards
Christian Bauer


Thanks for your video.

Please also provide the code you are using in this video. I think, it will also be helpful in sorting out this issue.

I have also logged your issue in our database. Development team will look into this issue and if there is some fix available or any other update/workaround, we will let you know asap.

This issue has been logged CELLSNET-40546.

There is not so much code:

The Excel is loaded with:

gridDesktop.ImportExcelFile(fileName, false);
for (int i = 0; i < gridDesktop.Worksheets.Count; i++)
gridDesktop.Worksheets[i].Protected = true;

The problem occurs in:

Aspose.Cells.GridDesktop.CellRange range = gridDesktop.GetActiveWorksheet().GetLastSelection();

This code is executed immidiately after the OK Button of the form containing the grid is pressed.

Please don't overlook, that sometimes during selecting/scrolling the grid crashes the whole application!!

Best regards
Christian Bauer


Thanks for your posting.

Yes, the code is simple but you are using some source file that could cause this problem.

Please also provide the source xls/xlsx file which you are using in the above code.

If you could provide the entire sample project with source files, then that would be even better.


Please see the attached solution. It includes an Excel Workbook (SampleXLS.xlsx).

Steps to reproduce the bug:

1) Build an run the solution. Click "Open Excel" and choose this Excelfile
2) The gridDesktop opens up. Use the mouse to select cell "A1"
3) Keep left mouse button down and move the mouse curser to the right, leave the window
4) Wait until the selection is scrolled to column "BH"
5) Click OK and see the Exception thrown from XLSSelectRangeForm.cs line 85.

Best regards

Christian Bauer


Thanks for your postings and providing us further information and project files.

We have logged them in our database and we will get back to you asap.


We were unable to replicate the problem with the steps you mentioned in 373131

Your project is working fine.

Please see the screenshot below.