Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

Linked tables to Excel spreadsheets

Return to Member Forum

  • Author
    Posts
    • #96663
      San Marco
      Member

      Hello everyone,

      I’m looking for a script or advices to write a script which could to unlink Excel spreadsheets.

      Actually I have created many tables based on linked spreadsheets but I didn’t unlinked them before modifying their content. Now I cannot uncheck the click the unlink option without updating the table first.

      My colleague inadvertently clicked on “update links” when opening the file … Fortunately I was able to retrieve the data from a backup, but I lost several hours to restore everything.

      Thank you !!

    • #96681
      San Marco
      Member

      This is a recurrent problem that I have not yet been able to fix (those tables have been shared, duplicated and modified many times in various catalogues). I hope some kind soul help me to get rid of it! Thank you!!

    • #96701
      Bob Rubey
      Member

      Absolute shot in the dark here…

      With no documents open, have you tried changing your File Handling options in Preferences so that INDD does not check links when opening the document(s)? Perhaps you would be able to unlink the tables then?

      I’m sure you tried as well, but I wasn’t able to locate an existing script.

      Good luck!

      • #96892
        San Marco
        Member

        Hi Bob,

        Thanks for your suggestion but unfortunately it doesn’t change anything, it’s still impossible to unlink the files, I’m only allowed to relink the file or update the links which I want to avoid absolutely.

        Thank you again!

    • #96897
      Bob Rubey
      Member

      San Marco,

      Looks like this one has cropped up before: https://creativepro.com/topic/unlinking-excel-files

      And it looks like a “Catch 22,” INDD won’t let you unlink till you relink or update. Not good at all.

      • #96933
        San Marco
        Member

        Hi Bob,

        I know this old post which confirms what I was afraid of, it is impossible to solve the problem through the interface. That’s why I’m looking for a script (or the appropriate functions) to un un unlink embedded files.

        Thank you!

    • #96934

      San Marco, I did’nt write here anything, because I tried this last week with the same conclusion as David in the other post: Simply unlink them. But it seems, that there is any kind of unwanted behavior.

      I’m not sure, if this can be solved with any kind of scripting, but you can send me a idml and one linked excel-file and I will have a look at it to forum@ruebiarts.de

      Kai

      • #96937
        San Marco
        Member

        Hi Kai,

        Thank you very much for your proposal, but to avoid further problems I spent my weekend creating the different tables temples and now, it is up to my dear colleagues to copy/past the data into these tables. But anyway I’m still curious to understand what prevents these embedded files from being unlinked.

    • #96935
      San Marco
      Member

      Amazing !!!

      Finally I succeeded to write the hereunder Javascript, which works fine, but with the same result ! It’s impossible to unlink the Excel files without, first, updating the links. But on the other hand, I’m allowed to remove them, which doesn’t really help me… Grrrr

      Maybe someone can tell me what I’m missing here ???

      if (app.documents.length == 0) alert(“No documents are open. Please open a document and try again.”);
      var myLink;
      var linkName;
      var myDoc = app.activeDocument;
      var links = myDoc.links;
      var MyCounter= 0;
      for(var i = 0; i<links.length; i++){
      myLink = links[i];
      linkName = myLink.name;
      if (myLink.status == LinkStatus.LINK_OUT_OF_DATE || myLink.name.substr(linkName.length-5) == ‘.xlsx’){
      MyCounter++;
      alert (“link nb “+MyCounter+”: “+myLink.name);
      //myLink.update();
      //myLink.remove();
      //myLink.unlink();

      }
      }

    • #96936

      Without studying your code, but if it doesn’t work in the UI, it won’t work with scripting too.

      So I would think in another direction: Create new tables, copy the content from a > b and delete a. Of course everything with a script.

      • #96938
        San Marco
        Member

        It makes sense, although I was hoping that the script would have been able to avoid some restrictions and go directly to some functionalities. But it seems that this is not the case. Too bad!

    • #96939

      Yep. But life can be easier, if you e.g. select two frames with identical cells and copy your content from a > b:

      var oldTable = app.selection[0].tables[0].contents;
      app.selection[1].tables[0].contents = oldTable;

    • #96941
      San Marco
      Member

      Waow that’s a real magic trick!!

      Thank you so much !!!

Viewing 8 reply threads
  • You must be logged in to reply to this topic.
Forum Ads