Page 1 of 1

[Solved] Cells selected after selecting active sheet ?

PostPosted: Tue Dec 03, 2019 6:26 am
by oonk
Code: Select all   Expand viewCollapse view
Option Explicit
'Based on https://forum.openoffice.org/en/forum/viewtopic.php?f=20&t=68059#p303317
Sub ChangeActiveSheet
   Dim oSheet As Object
   oSheet = ThisComponent.Sheets.getByName("Journal")
   ThisComponent.CurrentController.Select(oSheet)
End Sub

Sheet "Journal" shows, but all its cells are selected.
How can I move the cursor to only cell A1 in order to unselect all cells ?

Re: Why are all cells selected after selecting active sheet

PostPosted: Tue Dec 03, 2019 6:56 am
by FJCC
I think this will get you what you want.
Code: Select all   Expand viewCollapse view
oSheet = ThisComponent.Sheets.getByName("Journal")
ThisComponent.CurrentController.setActiveSheet(oSheet)

Re: Why are all cells selected after selecting active sheet

PostPosted: Tue Dec 03, 2019 8:05 am
by oonk
Thank you so much, that is really what I need.