Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hi

Another proposal:

Sub PysSelectRow
dim oCursor as object, oSheet as object, oCell as object
dim rowx as long

rowx = 2310

oSheet = thiscomponent.sheets.getByName("Sheet1")
oCell = oSheet.getCellByPosition(0, rowx)
oCursor = oSheet.createCursorByRange(oCell)
oCursor.expandToEntireRows
thiscomponent.currentController.select(oCursor)
thiscomponent.currentController.setFirstVisibleRow(rowx)

End Sub

Nota: you can comment the expandToEntireRows according to your needs

Regards

Hi

Another The setFirstVisibleRow command may not work if the cursor is for example in the frozen window.

So another proposal:

Sub PysSelectRow
dim oCursor as object, oSheet as object, oCell as object
dim rowx as long

rowx = 2310

oSheet = thiscomponent.sheets.getByName("Sheet1")
oCell = oSheet.getCellByPosition(0, rowx)
oCursor = oSheet.createCursorByRange(oCell)
oCursor.expandToEntireRows
thiscomponent.currentController.select(oCursor)
thiscomponent.currentController.setFirstVisibleRow(rowx)

End Sub

Nota: you can comment the expandToEntireRows according to your needs

Regards