Linked to named cells in other files fails if that file is not open

In “Source.ods”, cell B1 contains an integer. I have defined a Document (Global) name “Nasty” for that cell.

In a seprate Calc sheet, this always works:

='file:///home/someone/Documents/Source.ods'#$Sheet1.B1

But this gives “#NAME?” unless Source.ods is opened first.

='file:///home/someone/Documents//Source.ods'#Nasty

That seems like a bug?

I can create a link to that named range using “Sheet, Link to external data” but that is not ideal (I’d prefer to the the explicit link).

It is still your secret in which version of LibreOffice the error is supposed to be.

=DDE("soffice";"//home/someone/Documents/Source.ods";"Nasty")

Version: 7.3.7.2 / LibreOffice Community
Build ID: 30(Build:2)
CPU threads: 4; OS: Linux 5.19; UI render: default; VCL: gtk3
Locale: en-GB (en_GB.UTF-8); UI: en-GB
Ubuntu package version: 1:7.3.7-0ubuntu0.22.04.2
Calc: threaded

Thanks @Villeroy - that works for me.

I should mention that this type of link loads the source document invisibly. It fails when the document is not availlable. The file:/// links use a cache of the linked data embedded in the target document.

That seems reasonable, thanks. So if DDE succeeds we can be sure that the result is correct.

The reason is that for external references the sheet names and used cell data are cached and stored in the target document, but not names nor what names would resolve to (remember it could be cell ranges or any kind of formula expressions that without the source document may not make sense at all).
Related: tdf#145994.