Page 1 of 1
[Solved] Macro Calc to deselect all cells
Posted: Sun Mar 06, 2016 10:12 am
by ghizzo74
Hi!
I've not found a example wich show me how to deselect ALL the selected cells in the current sheet using a Macro.... Can someone help me?
Thanks a lot in advance!

Re: Macro Calc to deselect all cells
Posted: Sun Mar 06, 2016 10:53 am
by Villeroy
Code: Select all
dummy = ThisComponent.createInstance("com.sun.star.sheet.SheetCellRanges")
view = ThisComponent.getCurrentController()
view.select(dummy)
Re: [SOLVED] Macro Calc to deselect all cells
Posted: Sun Mar 06, 2016 1:27 pm
by ghizzo74
Thanks Villeroy!
It works nicely....in the meanwhile i've found an alternative way using the Uno API
Code: Select all
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dispatcher.executeDispatch(document, ".uno:Deselect", "", 0, array())