Fixing error 540

simple link tetween 2 calc files results in error540

And did you try to reload using Edit -> Links to External Files ... -> Button: Update?

And it does not SAVE the file after i break the link. When i break the link, reload file - the link is still there! 7.6.2.1 Ubuntu 22.04
It save other things i do with the file - inserted a row, deleted some content from cells - all saved. But broken link is still there again.
The only thing which saved me - i cleared all the contents of the cells which were connected to external file. ooofff!
The problem is when i break the link to external file Calc does not change the value in a cell which contains an actual link. So the link stays untouched. That’s why it’s here again after reloading the file. I guess the link must be removed from the cell while keeping the cell’s text. This is a bug i guess. Where to report a bug?

Penny dropped.

If this is the first time you have made a formula link from “file A” to “file B” you will get the result Error 540.

To fix it, save file A, then reload it, tell it to "Enable Content " (not necessary if you’ve already got the link to file B on automatic update), and the formula with the linked file reference will work.

It worked for me.

Note: To enable content, after linking the cells, save the document, close it, open it again and it will display a notice in the upper part that gives you the option to enable the content.

You will also get error 540 if there are orphaned links in the workbook anywhere regardless if the reference link you are using is valid after allow updating from the security warning automatic update of external links has been disabled.

Remove orphaned links in edit, Links to external files. Or if beyond frustrated remove them all and redo = then click onto cell on other sheets/workbook and setup your “valid” links again.