LibreOffice Macros and User-defined functions through BeanShell or Javascript

4 replies [Last post]
konsolebox
Offline
Last seen: 1 year 25 weeks ago
Title:
Joined: 24 Jan 2013
Posts: 2

Hi. I found it quite difficult to create user-defined functions in Spreadsheets (Calc) through languages like Java (Beanshell) and Javascript as compared to Basic. I had read in some documentations that this could be done through Add-Ins (org.openoffice.sheet.addin.) and I’ve seen an example from it (CalcAddins.java; http://api.libreoffice.org/examples/java/Spreadsheet/CalcAddins.java), but I can’t see how it registers itself with LO (I also read http://wiki.services.openoffice.org/wiki/Passive_Component_Registration as well). There’s also a file named CalcAddins.components but I don’t how I could make LO recognize it, and I’m not sure if the script is valid for LO since it seems to be made for OpenOffice (documentation seems still points to http://wiki.services.openoffice.org/wiki/Passive_Component_Registration; and still uses the library path org.openoffice.). So basically I want to be able to do in Java or Javascript the things I could do in Javascript. If possible also I really want the scripts/features to be embedded in the Calc document but I also don’t know how.
I hope anyone could help me. Thanks.

karolus
Offline
Last seen: 18 hours 49 min ago
Title: ★★★★★
Joined: 11 Mar 2012
Posts: 173
Calc AddIns

Hallo

See Example-AddIn @
http://www.biochemfusion.com/doc/Calc_addin_howto.html
( its for Python but the Steps todo are similar in other Scripting-Languages )

Karolus


konsolebox
Offline
Last seen: 1 year 25 weeks ago
Title:
Joined: 24 Jan 2013
Posts: 2
Hi. Thanks for the reply.

Hi. Thanks for the reply. Would that apply to LO as well? How does the passive compenent registration affect it? I plan to use Java or Javascript btw so conversion might be hard for me; noting that the implementation on the examples seem different from the one described on the link.

karolus
Offline
Last seen: 18 hours 49 min ago
Title: ★★★★★
Joined: 11 Mar 2012
Posts: 173
Hallo I don’t know what

Hallo
I don’t know what ‘passive component Registration’ means.
but i’m pretty sure that there are no significant differences in AddIn-Interface between LO and AOo.

Karolus


new_OOo3
Offline
Last seen: 39 weeks 2 days ago
Title:
Joined: 16 Aug 2011
Posts: 2
For your reference.

Hi, konsolebox
Do you want to know how to use Calc as a function of the JavaScript Function?
There are examples of using the JavaScript eval function in Calc next to URL. For your reference.

[ Example using JavaScript Function in Calc. ]
http://openoffice3.web.fc2.com/OOoBasic_General2.html#OOoGJS02a

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.