| View previous topic :: View next topic |
| Author |
Message |
nom OOo Enthusiast

Joined: 17 Dec 2003 Posts: 153 Location: NSW, Australia
|
Posted: Tue Apr 13, 2004 1:50 am Post subject: Select current sheet (a work around...) |
|
|
I have been looking for a way to select the current sheet, but couldn't find an elegant answer. The best I could come up with is to select the sheet that has a "cell" selected.
If anyone knows the "elegant" answer to this, please post a reply:
| Code: |
oDoc = ThisComponent
' Get the currently selected cell.
oView = oDoc.getCurrentController()
oCell = oView.getSelection()
' Get cell address
iCellRow = oCell.getCellAddress.Row
iCellCol = oCell.getCellAddress.Column
iCellSheet = oCell.getCellAddress.Sheet ' THIS IS THE IMPORTANT ONE
oSheet = oDoc.getSheets().getByIndex(iCellSheet)
|
nom |
|
| Back to top |
|
 |
SergeM Super User

Joined: 09 Sep 2003 Posts: 3211 Location: Troyes France
|
|
| Back to top |
|
 |
nom OOo Enthusiast

Joined: 17 Dec 2003 Posts: 153 Location: NSW, Australia
|
Posted: Fri Apr 16, 2004 4:39 am Post subject: |
|
|
Hi Serge,
That is exactly what I was looking for. Thanks!
nom |
|
| Back to top |
|
 |
SergeM Super User

Joined: 09 Sep 2003 Posts: 3211 Location: Troyes France
|
|
| Back to top |
|
 |
|