Ask Your Question
1

LO Calc: relative path to external sheet?

asked 2018-06-21 20:57:09 +0100

az2000 gravatar image

How can I express the following:

'file:///home/mark/Desktop/L4L/Products/material costs.ods'#$Webbing.$C$2:$C$6

as a spreadsheet in the same directory? I.e., no absolute path. Example:

'file://material costs.ods'#$Webbing.$C$2:$C$6

I've tried various things. LO keeps changing it to an absolute path. I have click a different cell and then click back to the one I edited to see how LO reverted it to an absolute path.

The only reason I'd like it to be relative is to make my formula's less tedious. (They're pretty busy-looking with the same path 4-5 times in one formula.).

Thanks in advance.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2018-06-22 20:12:34 +0100

hjek gravatar image

Yes, you can do that:

=INDIRECT("'./material costs.ods'#$Webbing.$C$2:$C$6")

I guess another use case for this would be sending projects with more than one spreadsheet to other people without broken references.

(If this works for you, please click on the ✓ to accept the answer.)

edit flag offensive delete link more

Comments

1

Thank you so much for your answer. I have accepted it. But, I have to say that seems like not a good solution. I wish LibreOffice had a more elegant way of doing this. That will look as "busy" (multiple times in a cell's formula) as the actual path. But, I can see how your solution will be more portable. So, that's good. (My issue was more about the business of the absolute path appearing 4 times in the same cell. A relative path would make the cell more readable.). Thanks!

az2000 gravatar imageaz2000 ( 2018-06-22 21:30:37 +0100 )edit
1

Yes, adding another function call doesn't make it look less busy.

Also, it appears that this question has been discussed previously:

The reference is always shown absolute. It will nonetheless be saved relative to the document if the respective option is chosen.

So, apparently you may be using relative paths anyway. Not sure if that helps.

hjek gravatar imagehjek ( 2018-06-22 21:42:05 +0100 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-06-21 20:57:09 +0100

Seen: 349 times

Last updated: Jun 22 '18