| View previous topic :: View next topic |
| Author |
Message |
thierry07 Newbie

Joined: 13 Mar 2006 Posts: 2 Location: Bagneux, France
|
Posted: Tue Mar 14, 2006 12:05 am Post subject: How to freeze the panes with a macro in a calc sheet |
|
|
Hi,
I am looking for an OpenBasic macro (working with OOo 2.0) to freeze the panes of several sheets in my calc document and i don't know how to do so. Don't know neither how to do it on a single sheet !
Example: i'd like to freeze the first line and the two first columns while scrolling up and down.
I have tried to use the macro recorder, but the generated code is so ugly, i can't stand using it !
Is there anyone who could help me ? |
|
| Back to top |
|
 |
uros Super User


Joined: 22 May 2003 Posts: 601 Location: Slovenia
|
Posted: Tue Mar 14, 2006 3:42 am Post subject: |
|
|
Hi Thierry!
Try this:
| Code: | Sub Freeze
oDocument = ThisComponent
oController = oDocument.getCurrentController ' freezes active sheet
oController.freezeAtPosition(2,3)
oSheets = oDocument.Sheets
oDocument.getCurrentController.select(oSheets.getByIndex(1)) ' activate second sheet
oController.freezeAtPosition(4,5)
numSheets = oSheets.Count
For i = 0 To numSheets - 1
oDocument.getCurrentController.select(oSheets.getByIndex(i).getCellByPosition(0,0)) ' activate all sheets one by one
oController.freezeAtPosition(0,6)
Next i
End Sub | Hope it helps!
Uros |
|
| Back to top |
|
 |
thierry07 Newbie

Joined: 13 Mar 2006 Posts: 2 Location: Bagneux, France
|
Posted: Thu Mar 16, 2006 4:36 am Post subject: |
|
|
It works perfectly !
Thank you. |
|
| Back to top |
|
 |
ssureshkumar Power User

Joined: 21 Dec 2005 Posts: 71
|
Posted: Wed Nov 29, 2006 1:20 am Post subject: |
|
|
hi uros,
can u post some sample code to do it the same in JAVA?
Thanks,
Suresh. |
|
| Back to top |
|
 |
uros Super User


Joined: 22 May 2003 Posts: 601 Location: Slovenia
|
Posted: Wed Nov 29, 2006 11:10 pm Post subject: |
|
|
Hi ssureshkumar!
Sorry, I can't help you. All I know about java is that it looks complicated.
Uros |
|
| Back to top |
|
 |
|