[Solved] Freeze Calc pane(s) with a Basic macro

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
jolumafe
Posts: 3
Joined: Mon Nov 25, 2013 1:09 pm

[Solved] Freeze Calc pane(s) with a Basic macro

Post by jolumafe »

It's possible? (freeze panes in a calc with Basic)

I found in the forum this file about the Calc API
There is a mention to an object/collection/structure called "Controller"
Controller
This is, in essence, the window object that is displaying the selected document. As such all the user viewable methods and properties are available via this object.

API Reference, service(s)
com.sun.star.sheet.SpreadsheetView

Parent object(s)
Document

Methods
createEnumeration
Creates an enumerated list of panes.

freezeAtPosition(<l_columns>,<l_rows>)
Freezes panes with the specified number of columns and rows. To freeze only horizontally, specify rows as 0. To freeze only vertically, specify columns as 0.
So the method is "freezeatposition" but I don't know how to reference "Controller" by code. I'm going to try a little ...
Last edited by Hagar Delest on Mon Nov 25, 2013 5:42 pm, edited 1 time in total.
Reason: tagged [Solved].
OpenOffice 3.1 on Windows Vista
jolumafe
Posts: 3
Joined: Mon Nov 25, 2013 1:09 pm

Re: Freeze calc pane(s) with a Basic macro

Post by jolumafe »

Well the key is not controller but Currentcontroller

This works like a charm:

Code: Select all

dim doc as object
Doc = ThisComponent
doc.currentController.freezeAtPosition(2,2)
OpenOffice 3.1 on Windows Vista
Post Reply