How to find and remove external links in (Libre|Open)Office Calc spreadsheet

6

I have a LibreOffice Calc spreadsheet which pops up a message asking me whether I wish to update external links. I did not add external links myself, but did copy data from another Calc window at one point, after which this issue started. (I assume this issue is not specific to LibreOffice, but also present in OpenOffice.)

The only hints I found were on the LibreOffice Forums: http://en.libreofficeforum.org/node/8150

Based on these hints, I investigated and found out the following:

  • The menu Edit > Links is greyed out. (Edited, had erroneous External > Links before.)
  • Searching for ///, ://, *.*s did not return any results.

So: how do I find and remove the alleged external links.

EDIT: I am using a .fods file, so searching through the xml source is something I can do; I found:

   ...
   <table:table table:name="&apos;file:///path/to/somefile.fods&apos;#Sheetname" table:print="false" table:style-name="ta_extref">
    <table:table-source xlink:type="simple" xlink:href="relative/path/to/a/temporary/copy/I/once/made/of/somefile.fods" table:table-name="Sheetname" table:mode="copy-results-only"/>
      ...
   </table:table>
   <table:named-expressions/>
   <table:database-ranges>
    <table:database-range table:name="__Anonymous_Sheet_DB__0" table:target-range-address="Sheetname.A1:Sheetname.C1048572">
    ...

So it seems that there is a hidden sheet in my file...

equaeghe

Posted 2015-01-25T10:51:30.090

Reputation: 291

I have the same problem, or even worse: the file is .ods, Edit>Links is not greyed out, but following the procedure in Help (select linked file and click "break the link") does no good: after saving, closing, re-opening, the link is back! :angry: – L. Levrel – 2017-03-31T08:57:33.943

Found this so it looks like the linked file has to exist for the link to be removed! Wow. ("Break Link ... will embed the file.")

– L. Levrel – 2017-03-31T09:06:07.020

The existence of the linked file is not enough: in Edit>Links, I could replace the non-existent linked file by another, randomly picked file (buttons Modify, then Update, then Close); after that, I saved, closed, reopened, Edit>Links, Remove link, saved, closed, reopened: "Do you want to update links"... – L. Levrel – 2017-03-31T09:14:52.893

1Note: the greying out may be due to your file format. When I tried and saved my faulty file in xls format, the menu item was greyed out but LO still asked if I wanted to update links. So you may want to try and save your file in ods format, if only to see the Edit links window! – L. Levrel – 2017-03-31T09:28:17.077

Answers

4

I also got that popup on startup:

enter image description here

I had the same problem and found out today that there is an option in the Edit menu called Links.... Select that option and you get a dialog with the list of external links found in your document.

enter image description here

Select the link(s) you want to remove and then click on the Break Links button. It will ask you for confirmation. Say Yes. Now the link is gone. Make sure to save. To test close LibreOffice and reopen your document. It should not ask you to update anything if you removed all those links.

What if Edit » Links... is Greyed Out?

As per a comment above by L. Levrel, it looks like LibreOffice keeps the Links... menu item greyed out if you load a file which is not a .ods file. In that case, try saving to a .ods, close everything then try reloading the new file. This time the menu item should not be greyed out. Of course, you may lose some formatting when converting between formats. Watch out!

Source: https://help.libreoffice.org/Common/Edit_Links

Alexis Wilke

Posted 2015-01-25T10:51:30.090

Reputation: 447

While this is a decent answer, in my case, “Edit > Links” is grayed out; see L. Levrel's second comment to my question for more about the “Edit > Links” functionality. – equaeghe – 2018-02-27T14:09:17.800

While a full search failed to give me a result, this worked. – AxelH – 2018-09-03T06:58:52.453

@equaeghe Thank you for pointing that out. I updated my last paragraph to reflect what Levret said in his comment. – Alexis Wilke – 2018-09-04T16:08:15.077

3

Every time I opened up a Calc Sheet I had copied, I received the same pop up "This file contains links to other files. Should they be updated?"

The spreadsheet I was opening was copied from another one, but each spreadsheet should stand on its own.

I came to this page looking how to get rid of that pop up - that is:

How can I find cells in my spreadsheet that have formulas linked to other files, so I can change the contents of THOSE cells so that they no longer link to other files?

Following snippets of the conversation here, I tried this:

Used Find and Replace, I changed the options to look in "Formulas", and to look at "All sheets" in the book. In the "Find:" text I typed in "file" (without the quotations).

By clicking on "Find Next" I was able to step through the sheet, finding each cell that had a formula with the text string "file" in it (which represents a link to another file), and removed the complete link to the other file, typically only leaving the actual cell references. (which then refer to the current sheet)

EXAMPLE:  the search found the formula:

    'file///c:documents/myusername/example.ods'B62

and I removed the file reference within the single quotes to leave

    B62

When "Find and Replace" did not find any more instances of "file" in forumulas, I saved and re-opened the sheet.

The pop up regarding links no longer appeared.

Al Walding

Posted 2015-01-25T10:51:30.090

Reputation: 41

Good answer. This worked for me. But to clarify my experience: The search&replace pointed to the problematic cells. I then had to click on those cells to see the formula containing the 'file' reference. Fixing the file was done manually by fixing one formula and copy-pasting it across. – PatrickT – 2018-05-15T07:56:43.540

2

Had the same problem myself, and after reading the discussion here, I tried copying the sheets I wanted to a new file (in my case this was easy as I only had one sheet), and that fixed it for me. It may be that the problematic hidden sheet is in that file, and so creating a new file could avoid the problem. I'm not sure how this would go with a complex spreadsheet with lots of sheets though.

Alternatively, you could try looking up how to un-hide a sheet? (I've done this in Excel - VBA lets you get at additional levels of hiding too - but I think this might not actually be the problem, so I'd try the "copy to new sheet" first).

BevanFindlay

Posted 2015-01-25T10:51:30.090

Reputation: 116

1Your solution worked for me, but you do not state clearly it worked for you! You should reword it. Note that one can copy several sheets at a time: simply select them and use Move/copy sheet as usual. – L. Levrel – 2017-03-31T09:20:47.037

1

When performing the suggested approach 'Find all "file" formulas I noticed that this alone may not be sufficient. In my case Change recording was enabled which resulted in the link to the remote file still being active. Once all recorded changes were accepted and Track Changes was disabled, I could succesfully break the link to the remote file.

Erik van Veelen

Posted 2015-01-25T10:51:30.090

Reputation: 11

1

There is a simple way of blocking by going to, on the top toolbar: Tools/Options/LibreOffice Calc/General Top right of window is 'Updating/Update links when opening' Choose from: Always/On request/Never

David ZZZ

Posted 2015-01-25T10:51:30.090

Reputation: 11

0

For me the solution was simply to copy the file over to /tmp, open it in gnumeric, which listed all my fields with the wrong/incorrect references.

Then went back to libreoffice, and cleaned up the cells from gnumeric's error message.

To be sure, I have also explicitly "broke" the link before saving the file.

ltuska

Posted 2015-01-25T10:51:30.090

Reputation: 101

0

I encountered a similar problem. I had copied some rows from one sheet that contained links to a second sheet in the same spreadsheet file, to a second spreadsheet file. I then deleted the copied rows from the first spreadsheet. It turns out that there were other links in the first spreadsheet to the copied rows. I found that these links were, e.g., "=sheet1.#REF". The links did not update with the new spreadsheet name, but were left behind in ambiguous form. However, Calc somehow tagged them as links to external files. When I deleted the cells with the ambiguous links, the problem went away.

Jonesy

Posted 2015-01-25T10:51:30.090

Reputation: 1

-1

You may not want to remove the external link. An external link is a connection to a cell in another spreadsheet. To make an external link, press =, switch to the second spreadsheet and select a cell, press Enter. It acts as any reference to a cell, so you can use it in calculations. If the value changes in the second sheet, the first sheet will update the value when you update external links.

If the cell has a constant value, then you could copy and paste the cell from the second sheet to the first.

You could also combine the 2 spreadsheets into 1, so everything is in the same file. The external link becomes link to another sheet.

LDC3

Posted 2015-01-25T10:51:30.090

Reputation: 2 062

I understand what an external link is and why it can be useful. As described in my question, the external link is not useful and the accompanying pop-up is annoying. Moreover, the hidden (or ‘anonymous’) sheet is useless and unwanted. I'm downvoting this answer because you did not answer the question and assumed I did not know what I was talking about, even though it should be clear from my question that I am. – equaeghe – 2015-01-25T15:46:14.707

You didn't read the second and third paragraphs. I gave you 2 options which will not have the pop up. – LDC3 – 2015-01-25T16:12:20.367

You can delete all external links in the file by selecting File, Links and then deleting the files that are externally linked. – LDC3 – 2015-01-25T17:21:53.437

I did read the whole answer, but as is clear from my question, I neither manually added the links, nor am I interested in doing that. Furthermore, as stated in my question, Edit > Links (no File > Links present here) is greyed out. – equaeghe – 2015-01-25T20:18:20.623

1To find the sheet that has the link on it, move each sheet, one at a time, to a new file, close the spreadsheet and then open it to see if it asks to update. When it no longer asks, than the link is on the last sheet you moved. – LDC3 – 2015-01-25T20:55:11.557

As suggested by the source extract in my question, the link is not in any of the visible sheets, but in a hidden (or ‘anonymous’) sheet. I checked this by following your suggestion: even after removing all the sheets (adding an empty one was necessary for that), the pop-up message appears and in the source the same hidden sheet is present. (It shouldn't be, of course.) – equaeghe – 2015-01-25T22:25:01.013

You could try saving the spreadsheet as a CVS file (I think it only saves one sheet at a time). At this point you can review the CVS file with Notepad to look for the link. Then read them into a new spreadsheet. – LDC3 – 2015-01-25T22:42:44.650