Oh, JEC. I think you gave me a decisive hint in your comments! Provided further testing maybe the solution....
Up to now (leading to the problem) I opened the workbook like
Now I tried this (based on your Power Query hint]:
I recorded a macro when setting up a Power Query connection to an (existing) file. Then I changed the target file name in the recorded code to a file that should not be found due to renaming. Of course this led to a Power Query error. Holding the mouse to the data connections bar displayed the yellow error message. In that message, the URL of the file (which was not found) was composed like this:
.
Note, since I'm a newbie in this forum I'm not allowed to post links, so [TEXT] stands for the beginning of the URL (that works).
Adding the "_api/web/getfilebyserverrelativeurl"-stuff to my report macro seems to give the expected results: - Exact filename is there = File is opened
- Exact filename is not there (for whatever reason) = error message
I'll do a bunch of tests now and of course let you know if my heart has survived the day... 
Many thanks!
Update: The REST API reference with "getfilebyserverrelativeurl" works properly and throws error messages when expected.
Bookmarks