Reply To: Linked tables to Excel spreadsheets

#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();

}
}

This article was last modified on August 21, 2017

Comments (0)

Loading comments...