We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Opening and saving the file with Aspose.Cells adds the number of the links in the file

Hello dear Aspose team,

We hope you will help us to clarify something for us. We have a program which works with the links in Excel files and uses Aspose for some other actions with those Excel files.
In the attached sample file (“TestFile.xlsx”) our program is able to find 5 links. We can also see 5 links, if we unzip the file and go to “xl -> externalLinks” section in the file’s XML structure.

However, when we open and save this file with Aspose.Cells, we can see that it adds 2 more links in this folder making the total of the links 7! Why does this happen?
We tested with 2 versions of Aspose.Cells - 19.8 and 22.5.
Aspose.Cells 19.8 does not handle this file good. One of the new links in 19.8 has value “1”. Also when you open the file after saving Excel shows a dialog about file corruption. (I assume this was a bug which is fixed in 22.5)

Steps to reproduce

A. Either open and save attached sample file with Aspose.Cells.
B. Or run the sample console program provided. It will save the output in “bin” folder. (you can directly go to bin folder since we already run the program and left the output there).

Sample file - https://drive.google.com/file/d/1ZW8OuBW6HR1a_wNwf00n47oPsdG8oxAE/view?usp=sharing

Sample project - https://drive.google.com/file/d/1DspFpFo0XMqaoD-cxXHPCDy0a60IcAOE/view?usp=sharing

NOTE: Note that when you open this (or modified by Aspose) files in Excel, in the “Edit Links” window both will report only 4 links - we are not sure why yet.

@vahem,

Thanks for the template file and details.

I tested using our latest version/fix: Aspose.Cells for .NET v22.6 by simply re-saving your template XLSX file. I found the output XLSX is corrupted and MS Excel does not open it properly. Anyways, to investigate your issue in details, I have logged a ticket with an id “CELLSNET-51307” for your issue. We will look into it soon.

Once we have an update on it, we will let you know.

PS. I have made this thread as private since you have included license in your sample project. Please remove the license from your project and re-upload the updated project again.

@Amjad_Sahi Thanks for noticing that. I’ve re-uploaded a new version of the sample project and removed the other one. Please make the thread public again.

@vahem,

Thanks for doing the needful. I have made the thread public again.

@vahem
Please use 22.6.1
There is an issue in 22.6.

Thanks @simon.zhao, we tried. Unfortunately, we don’t see any difference between 22.5 and 22.6.1 versions of Aspose.Cells. The original question is asked about Aspose.Cells 22.5, we haven’t even tested 22.6 yet.
I will try to re-phrase our question

  1. When we open the file, we are getting asked to edit links in this file. Microsoft Excel’s “Edit Link” window shows 4 links there.
  2. However when we unzip the file, in the “xl -> externalLinks” folder we can see that there are 5 external links. (Okay, we don’t know what is the extra link there, but this is not related to Aspose.Cells for sure - this is the original file).
  3. When we re-save the file using Aspose.Cells 22.5 or Aspose.Cells 22.6.1, we can see that the number of links in the “xl -> externalLinks” folder is increased from 5 to 7!

The problem for us is that our internal file handler was finding 5 links in this file, but after doing some modifications using Aspose.Cells it starts to find 7 links. We want to understand why Aspose.Cells adds external links making the number of overall links from 5 to 7.
We also would like to understand why “Edit Links” window in Microsoft Excel shows only 4 links, but this is more like a side-question, since it is not related to Aspose.Cells.

@vahem,

Please note, we fixed the file corruption issue in Aspose.Cells 22.6.1, the issue was there in Aspose.Cells 22.6.0. But you are still right for your observations as I tested:

We will provide details on why Aspose.Cells renders 7 external links and clarify your doubts. If in any case, this (adding 2 extra links) is an issue, we will figure it out in Aspose.Cells APIs. We will get back to you soon.

@vahem
About the issue of 2 additional exernal links, we will fix it in the next version 22.7.

@vahem
After careful research, it is found that the two newly added external links are caused by validation. Please check Sheet19.xml. Microsoft has not unified the external references of Validation into the list of external links. We think that it is not a problem to collect all external links together. , so we do not plan to fix it.

@simon.zhao Thanks for your reply. Do you think this can be caused by the fact that the user may used some Excel add-ins? I’ve never heard about Microsoft doing something like that.

We will evaluate it and get back to you soon.

@vahem
validation.zip (543 Bytes)
It’s forbidden to input such formulas of validation in MS Excel.
So it must be added by other tools.