Ask Your Question

sdk hyperlink function

asked 2016-10-25 17:00:16 +0200

simple gravatar image

updated 2016-10-25 17:01:56 +0200


I'm learning to use the Java sdk (libreoffice and sdk version 5.2). I started with the example and tried to do some small modifications. I'm interested in being able to insert a hyperlink in a cell. I tried to insert the following formula '=HYPERLINK("#A1", "TEST")', the formula is inserted with no visible problem, but libreoffice gives an error 508 (Pair missing). If I try to do the same without the second argument of the HYPERLINK function, it works fine. My Java code Looks like this:

xSheet.getCellByPosition(0,4).setFormula("=HYPERLINK(\"#A1\", \"TEST\")");

Any idea what I am doing wrong or is it a bug?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2016-10-25 17:37:04 +0200

karolus gravatar image

Hallo Use ; instead comma as Argumentseperator…

for me works(with python):

sel = XSCRIPTCONTEXT.getDocument().CurrentSelection
sel.Formula = "=HYPERLINK(\"#A1\"; \"TEST\")"

but python allows also outer quoting with single quotes:

sel = XSCRIPTCONTEXT.getDocument().CurrentSelection
sel.Formula = '=HYPERLINK("#A1"; "TEST")'
edit flag offensive delete link more


Thanks karolus, replacing the comma with a semicolon solved my problem.

simple gravatar imagesimple ( 2016-10-26 11:16:19 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2016-10-25 17:00:16 +0200

Seen: 57 times

Last updated: Oct 25 '16