| View previous topic :: View next topic |
| Author |
Message |
angman General User

Joined: 30 Jan 2006 Posts: 6
|
Posted: Mon Jan 30, 2006 9:32 am Post subject: how automatically select a spreadsheet after opening a docum |
|
|
Hi, I am a newbie on star basic, and I could not find a function to programmatically select a sheet, after openining a documentt.
Somebody can suggest me a solution.
Thanks. angman  |
|
| Back to top |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 10065 Location: Germany
|
Posted: Mon Jan 30, 2006 1:33 pm Post subject: |
|
|
Wrong forum, but hey ...
| Code: |
Sub on_DocOpen()
REM uncomment in order to get second sheet (indices start at zero)
'oSheet = ThisComponent.getSheets.getByIndex(1)
REM uncomment in order to get a sheet by it's name
'oSheet = ThisComponent.getSheets.getByIndex("mySheetName")
ThisComponent.CurrentController..setActiveSheet(oSheet)
End Sub
|
Save the code in some module of library "Standard" in the document in question and assign the "Doc Open"-event to Document > Standard > Module1 > on_DocOpen |
|
| Back to top |
|
 |
|