Issue 49362 - DDE link cannot use relative file paths
Summary: DDE link cannot use relative file paths
Alias: None
Product: Calc
Classification: Application
Component: ui (show other issues)
Version: 680m99
Hardware: PC Windows XP
: P3 Trivial with 18 votes (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
: 51371 55195 66288 (view as issue list)
Depends on:
Reported: 2005-05-17 00:33 UTC by illusion65
Modified: 2017-05-20 11:11 UTC (History)
8 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---

Source file: has the value being referenced by other file (6.11 KB, application/vnd.sun.xml.calc)
2005-05-17 00:34 UTC, illusion65
no flags Details
Links to "source" file showing failed "relative" DDE function (6.61 KB, application/vnd.oasis.opendocument.spreadsheet)
2005-05-17 00:35 UTC, illusion65
no flags Details
Updated w/ work around using CELL() info. Use previous "DDE-Bug-source.ods" as reference file. (7.22 KB, application/vnd.oasis.opendocument.spreadsheet)
2005-05-20 01:25 UTC, illusion65
no flags Details
solution: be sure to keep the original dir hierarchy (29.08 KB, application/x-compressed)
2007-02-02 15:58 UTC, oni_fanel
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description illusion65 2005-05-17 00:33:20 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.
Comment 1 illusion65 2005-05-17 00:34:36 UTC
Created attachment 26205 [details]
Source file: has the value being referenced by other file
Comment 2 illusion65 2005-05-17 00:35:40 UTC
Created attachment 26206 [details]
Links to "source" file showing failed "relative" DDE function
Comment 3 oc 2005-05-19 08:28:17 UTC
Hi Eike, please have a look
Comment 4 ooo 2005-05-19 14:40:53 UTC
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.
Comment 5 illusion65 2005-05-20 01:21:24 UTC
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.
Comment 6 illusion65 2005-05-20 01:25:21 UTC
Created attachment 26346 [details]
Updated w/ work around using CELL() info. Use previous "DDE-Bug-source.ods" as reference file.
Comment 7 Mathias_Bauer 2005-05-23 14:52:39 UTC
We already have too much issues for the next micro release -> set to "Later".
Comment 8 frank 2005-07-08 14:24:08 UTC
*** Issue 51371 has been marked as a duplicate of this issue. ***
Comment 9 frank 2005-09-30 09:27:29 UTC
*** Issue 55195 has been marked as a duplicate of this issue. ***
Comment 10 brody 2006-03-20 09:35:55 UTC
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.
Comment 11 frank 2006-07-10 12:42:05 UTC
*** Issue 66288 has been marked as a duplicate of this issue. ***
Comment 12 mailman42 2006-08-20 19:25:53 UTC
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.
Comment 13 Regina Henschel 2006-10-11 17:34:11 UTC
*** Issue 70305 has been marked as a duplicate of this issue. ***
Comment 14 oni_fanel 2006-12-08 18:53:11 UTC
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.
Comment 15 pjvenda 2007-01-08 13:07:21 UTC
OOo 2.1 on Linux reveals the same problem.
Comment 16 oni_fanel 2007-02-02 15:29:11 UTC
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.
Comment 17 oni_fanel 2007-02-02 15:58:03 UTC
Created attachment 42682 [details]
solution: be sure to keep the original dir hierarchy
Comment 18 mailman42 2007-02-02 17:39:46 UTC
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

Comment 19 illusion65 2007-05-16 23:44:00 UTC
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?
Comment 20 Mathias_Bauer 2007-05-17 16:40:44 UTC
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.

Comment 21 oni_fanel 2007-05-17 19:21:23 UTC
I can't replicate the crash. So I guess it was bad luck.
Comment 22 Mathias_Bauer 2007-05-17 19:31:53 UTC
Thanks for letting me know. 
Comment 23 kami911 2007-09-20 19:31:44 UTC
Hmm I have same problem. Can you fix it for 2.3.1?
Comment 24 Martin Hollmichel 2007-11-09 16:52:46 UTC
change target from 2.x to 3.x according to
Comment 25 Mathias_Bauer 2007-11-12 14:42:26 UTC
Martin, I prefer to keep that on the 2.x target.
Comment 26 Mathias_Bauer 2008-01-11 10:07:45 UTC
target 3.0
Comment 27 gossamer 2008-01-14 22:10:58 UTC
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?
Comment 28 Mathias_Bauer 2008-06-05 16:02:20 UTC
OK Martin, you won. :-)
Comment 29 Mathias_Bauer 2009-06-19 13:47:08 UTC
please take over
Comment 30 boulate 2010-06-08 11:12:56 UTC
Work with "classic" link ... but not with DDE ... 
Comment 31 Marcus 2017-05-20 11:11:30 UTC
Reset assigne to the default "".