[Solved] Deselecting a cell in Calc

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
Bastien
Posts: 61
Joined: Mon May 12, 2014 2:45 pm

[Solved] Deselecting a cell in Calc

Post by Bastien »

At the end of my macro execution, I got a cell selected. Is it possible to deselect it? Or should I select a cell beyond the visible part of the sheet?
 Edit: Not exactly solved but I didn't undertand there always was a selected cell on a sheet. 
Last edited by Bastien on Fri Mar 15, 2019 1:26 pm, edited 1 time in total.
LibreOffice 6.2.3.2 on Ubuntu 19.04
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Deselecting a cell in Calc

Post by Villeroy »

Select an empty collection of cells.

Code: Select all

cells = ThisComponent.createInstance("com.sun.star.sheet.SheetCellRanges")
ThisComponent.CurrentController.select(cells)
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Bastien
Posts: 61
Joined: Mon May 12, 2014 2:45 pm

Re: Deselecting a cell in Calc

Post by Bastien »

Thanks but it doesn't drop the selection. I still have a selected cell over the image I just inserted which is not very nice, but it doesn't matter. I'll look at it later.
LibreOffice 6.2.3.2 on Ubuntu 19.04
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Deselecting a cell in Calc

Post by Villeroy »

There is always one active cell on a sheet.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Post Reply