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

Keyboard macros or custom scripts

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

Postby jolumafe » Mon Nov 25, 2013 2:04 pm

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

Postby jolumafe » Mon Nov 25, 2013 2:36 pm

Well the key is not controller but Currentcontroller

This works like a charm:

Code: Select all   Expand viewCollapse view
dim doc as object
Doc = ThisComponent
doc.currentController.freezeAtPosition(2,2)
OpenOffice 3.1 on Windows Vista
jolumafe
 
Posts: 3
Joined: Mon Nov 25, 2013 1:09 pm


Return to OpenOffice Basic, Python, BeanShell, JavaScript

Who is online

Users browsing this forum: No registered users and 1 guest