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

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...


Solution 1:

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 Link button. It will ask you for confirmation. Say Yes. Now the links are 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

Solution 2:

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.