I found in the forum this file about the Calc API
There is a mention to an object/collection/structure called "Controller"
So the method is "freezeatposition" but I don't know how to reference "Controller" by code. I'm going to try a little ...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.