[Solved] I just want an interface...

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
hdquikprint
Posts: 7
Joined: Sat Sep 04, 2010 7:41 pm

[Solved] I just want an interface...

Post by hdquikprint »

OK, I know I'm missing something here, but darned if I can figure it out this time. I am trying to get access to the XViewFreezable interface from StarBasic (under Calc). It is exported by the SpreadsheetView service. But I can't seem to get that service. I've tried "ServiceManager", "CreateUnoService", "XServiceManager", "XMultiServiceFactory", ad nauseum. And I've tried all of the above on the doc(ThisComponent) and sheet(Sheets.getByName). Of course in many cases I get errors of the nature of "Can't find method", but in some cases the code actually executes but my object is still null. (e.g. oInt = doc.CreateInstance("com.sun.star.sheet.SpreadsheetView")) I have searched many, many docs/tutorials. They all mention UNO interfaces, and some even say things like "<it> can be accessed through the service manager.", but none, not one, nada, zilch, shows an example of doing this! All I ask is the XViewFreezable interface from Star Basic and my life will be complete! :knock:

...Jim...
Last edited by hdquikprint on Wed Sep 22, 2010 3:10 pm, edited 1 time in total.
OOo3.2, Windows 7 Home
ms777
Volunteer
Posts: 177
Joined: Mon Oct 08, 2007 1:33 am

Re: I just want an interface...

Post by ms777 »

Hi,

try

Code: Select all

Sub Main
oCurCont = Thiscomponent.CurrentController
oCurCont.freezeAtPosition(4,2) 'for freezing
'oCurCont.splitAtPosition( 0,0) 'to remove the freeze
End Sub
Good luck,

ms777
hdquikprint
Posts: 7
Joined: Sat Sep 04, 2010 7:41 pm

Re: I just want an interface...

Post by hdquikprint »

I can't believe it was that simple! I was trying to make it as hard as I could I guess. Obviously that worked. Now my project is fully functional as I had originally intended. Which means, of course, that I have already come up with ideas to extend it so I may be back.

...Jim...
OOo3.2, Windows 7 Home
Post Reply