Can't create relative hyperlink in Calc

I have a spreadsheet on which one of the columns must be an hyperlink to an external file. The hyperlink is static, and as such is being created by using the Insert->Hyperlink option. I have tried selecting the file from the file picker, inputting the relative file path directly, and even by placing the external files in the same folder as the spreadsheet and just inputting the filename.

All the created links seem to work perfectly, but upon saving and re-opening the document, I can see that Calc is trying to find the file using its last known absolute file path. This of course means that when I open the file in a different computer or OS, the links are broken.

Is there a way to create purely relative hyperlinks (that stay relative after saving and re-opening) with the Insert->Hyperlink option?

EDIT:

The “Save URLs relative to file system” option is checked, unchecking it produces broken hyperlinks when the file is re-opened (as in, hyperlinks with no target).

I ran some experiments by creating several different hyperlinks, saving and then opening the content.xml file inside the ODS container to see what was really being written to disk. It seems the only way Calc will save the relative path properly is when the file is selected using the file picker. Now the question becomes, is there a way to get the correct, expected behavior without using the file picker, to save time?

Menu/Tools/Options/LibreOffice/Load&Save/General - Save URLs relative to file system.

Relative file system path

The option was ticked on as default. Ticking it off meant that I wasn’t able to save hyperlinks with relative paths any longer, the link would have no target when re-opening the file. Will be adding extra information to the original question to address this answer as well as additional findings.

I am experiencing the exact same problem.

By default the LibreOffice option to store relative paths is checked.

I was using the text input by typing and pasting some file name from Windows Explorer instead of using the “Select file” button to browse to the file manually.

Scenario:

  • Create one cell link using the file browser, e.g. inside local dir “images” on same level as ODS “images\image01.jpg”
  • Create a second cell link pasting the file name, e.g. “images\image01.jpg”
  • Try the links, they will both work
  • Save the ODS file (XLS and XLSX don’t work at all here, these formats will delete all link info after closing LibreOffice!)
  • Exit LibreOffice and reenter the ODS file: both links should work
  • Exit LibreOffice again
  • Move the ODS + image files to some other place!
  • Reenter the moved ODS file: the first link will work, the second one doesn’t

→ hover your mouse over the cell links or press Ctrl+K… then you’ll see why the links don’t work.

Bug?

It looks like the file browser clicking somehow stores the ODS file location as a prefix while entering something into the text field manually doesn’t.

Comments anyone?