Reputation: 670
I do have a VSTO application, in which the selection is switched to some cell the code look like as follows
private void SelectCell(int rowNumber,int columnNumber)
{
Sheet.Cells[rowNumber, columnNumber].Select();
}
In this case the cell gets selected but the selection mark is retained on the last selected cell.
But when we press right arrow it switches to the next cell of the mentioned cell , or even we enter a value, the value gets entered in the newly selected cell. And at that time the selection over the last cell will be removed. While debuggin this issue is not observed but while running the application outside the IDE it has this issue.
Is there any idea to solve this?
Upvotes: 0
Views: 27
Reputation: 670
Setting ScreenUpdating to true has solved the problem.
private void SelectCell(int rowNumber,int columnNumber)
{
Sheet.Application.ScreenUpdating = true;
Sheet.Cells[rowNumber, columnNumber].Select();
}
Upvotes: 1