Apache OpenOffice (AOO) Bugzilla – Issue 49362
DDE link cannot use relative file paths
Last modified: 2017-05-20 11:11:30 UTC
When DDE linking from one spreadsheet file to another, the DDE "file" parameter must be a fully qualified path/filename (e.g.: c:\path\path\file.ods) and cannot be relative ("file.ods"). Relative file names work in OOo 1.1.4, but have been broken in all the beta 2.0 versions I've tried, including 1.9.100 (there was no entry for 680m100 when I reported this, so I selected 680m99) Two small ODS files will be attached to demonstrate this, but the "full-path" link will need to be updated to the proper path on your system to work properly.
Created attachment 26205 [details] Source file: has the value being referenced by other file
Created attachment 26206 [details] Links to "source" file showing failed "relative" DDE function
Hi Eike, please have a look
It was coincidence that relative file names worked sometimes (!) in OOo1.1.x DDE, maybe due to the static INetURLObject kludge that was removed in the mean time. OOo's DDE() function's help (also in OOo1.1.x) clearly states File is the complete file name, including path specification. Note that the syntax of DDE calls is application dependant, and the "file name" doesn't even have to be a file name in all cases, but more generally is a topic for the application called, though most times it will be a file. _If_ we wanted to change that to relative file names being recognized for the OOo application it should be done centralized in the DDE manager of the framework, I guess. Whether a file without path should be loaded from the WORK directory currently isn't clear to me, forwarding to Mathias.
That's interesting. I use that feature for my tax accounting: each year gets a set of spreadsheets (different path / folder per year) that do the computations for all the forms I need. It's easy to copy one year's contents into the next because the relative paths don't change. Otherwise there are hundreds of links to change. I just created a workaround: Use a CELL("FILENAME";A1) function to identify the current path, use REGEX to extract the path, combine that with the filename into the DDE or INDIRECT functions. It's a kludgy method, but I can create a separate sheet with these reference file formulas. I will post an updated "DDE-Bug-links.ods" file with this workaround, for those that may want to use it. Thanks for all your effort! This truly is a great product.
Created attachment 26346 [details] Updated w/ work around using CELL() info. Use previous "DDE-Bug-source.ods" as reference file.
We already have too much issues for the next micro release -> set to "Later".
*** Issue 51371 has been marked as a duplicate of this issue. ***
*** Issue 55195 has been marked as a duplicate of this issue. ***
Hi, thanks to 'illusion65' for the workaround; I use relative DDE-Pathes on windows (OOo 1.1.5 and before), too - so I voted for this issue for a general fix. I stumbled over this in Ooo2.0.2 while converting my OOo spreadsheets. Nevertheless its a great product. Many thanks to the developer community.
*** Issue 66288 has been marked as a duplicate of this issue. ***
It's been over a year on this report, not mention my report from earlier this year that was CLOSED due to being a duplicate. This is a very important feature that needs to be corrected. As it stands, I need to have 1.1.* installed to generate the reports I need.
*** Issue 70305 has been marked as a duplicate of this issue. ***
I agree. This is a very important feature. Let me remember you that the workaround doesn't work in writer, where you actualy can't add dynamic data in the link field of the DDE.
OOo 2.1 on Linux reveals the same problem.
Ok, I've found a solution. But this causes a new bug in writer. First of all, relative paths do still work, but the documentation doesn't cover it well. I hope it will be updated soon! If you want to use relative paths, in the DDE link field write this: "file:linkedfile.ods" if the 'linkedfile.ods' is in the same directory "file:subdir/linkedfile.ods" if the 'linkedfile.ods' is in a subdir called 'subdir' "file:../linkedfile.ods" if the 'linkedfile.ods' is in the root directory Please note: this works on both, writer (in the Links window) and calc (as the =DDE() argument). I've tested this on Win XP, but the fact it uses slashes instead of backslashes makes me think this works on linux too. But I can't confirm it. But be careful! If you update the links with the "file:" path (Modify->Links), when you try to "Modify->Paste Special->DDE Link", writer will crash! You can still add DDE links using "Ctrl+F2". I hope this will help.
Created attachment 42682 [details] solution: be sure to keep the original dir hierarchy
Just tried the "fix", and it works for OO 2.1 & OS X 10.4.8 Also works with Kubuntu Edgy, and OO 2.0.4 Thanks
Works in Ubuntu Feisty (7.04) w/ OOo 2.2.0-1ubuntu2 -- many thanks! This should RESOLVE/CLOSE the bug, right? I tried to recreate the crash you mentioned (using "Edit->Paste Special->DDE Link" to create the link, then "Edit->Links...->Modify..." to make it 'relative', then again to alter the formula), but all worked as expected. Can you give more details on how to re-create the crash?
oni_fanel: thanks for your investigations. I will try to verify from the code that what you found is a defined behavior or just luck. Or the other way around: in case it is not just luck I will document also in the code that this is the intended behavior. You wrote: >But be careful! If you update the links with the "file:" path (Modify->Links), >when you try to "Modify->Paste Special->DDE Link", writer will crash! You can >still add DDE links using "Ctrl+F2". So first I will try to find out why Writer crashes here and if this a bug in Writer or causes by your links that Writer considers to be invalid. I also have to check the documentation about DDE links in general as whatever we are using should create links that work fine when exported to other formats. In case we find that everything is fine with the links you have used we should update the documentation.
I can't replicate the crash. So I guess it was bad luck.
Thanks for letting me know.
Hmm I have same problem. Can you fix it for 2.3.1?
change target from 2.x to 3.x according to http://wiki.services.openoffice.org/wiki/Target_3x
Martin, I prefer to keep that on the 2.x target.
target 3.0
I am working on a spreadsheet with many DDE links. They were set up by selecting multiple cells cells in a file then doing a copy/Paste Special. Since it is an array I have to edit the link by going to Edit->Links. I can then change the source file to file:linkedfile.ods and it works. My problem is that the changes do not appear in the formula in the cell and the changes do not save. Is there anyway around this or do they have to be recreated using the wizard?
OK Martin, you won. :-) 3.x
please take over
Work with "classic" link ... but not with DDE ...
Reset assigne to the default "issues@openoffice.apache.org".