Hi,
Could you please tell me if there is a way to break links using Aspose.Cells for .NET?
I see that there is an option to break all links via RemoveExternalLinks, but is there an option to remove/break only some links?
Kind regards,
Nina
Hi,
Could you please tell me if there is a way to break links using Aspose.Cells for .NET?
I see that there is an option to break all links via RemoveExternalLinks, but is there an option to remove/break only some links?
Kind regards,
Nina
You may check and manipulate those links by ExternalLinkCollection which you can get from WorksheetCollection.
Hi @johnson.shi,
Thank you very much for your quick reply!
I see there is an option to “RemoveAt” and I assume that it does what I need.
Unfortunately, the version of Aspose.Cells that I’m using does not support this functionality, but I’m glad if this helps someone.
Cheers!
Yes, it will work for the purpose. You may upgrade to latest APIs set (if possible) to accomplish your desired task. See the sample code for your reference:
e.g.
Sample code:
var workbook = new Aspose.Cells.Workbook("e:\\test2\\Book1.xlsx");
var links = workbook.Worksheets.ExternalLinks;
var linksCount = links.Count;
for (int i = linksCount -1; i>=0; i--)
{
if (links[i].IsReferred)
{
links.RemoveAt(i);
}
}
Hope, this helps a bit.