Well, when I open your workbook and see the formulas in formula bar for the underlying cells (B1:B4), I can see the additional drive information/path with external file reference, so I think the ExternalLink.DataSource property gives valid data source as displayed in MS Excel. And, you are also right, when we check the XML in the path “xl\externalLinks_rels”, the data source is without drive’s details. I think you may easily get your desired data source from the ExternalLink.DataSource attribute while splitting or removing @ “:” to eliminate the drive (first part) by yourself accordingly.
problem is that Excel is adding this automatically when you check values in cells or do EditLinks. I cannot remove everything after : as there might be cases that I have drive in link which is not automatically added and by removing everything before : I might kill my link.
Now question is why Aspose is adding this what is not part of the XML document? Can we have additional property (with setter also) called Target which will show value from Target node?
Also did you notice that when you do mouse-over cell you see "C:\_Work\Toronto\Parent\parent.xlsx" and Target value is "/_Work/Toronto/Parent/parent.xlsx"so we have \ and / difference also.
If you copy it on C drive and open it in Excel you will see ExternalLink
"D:\_Work\Toronto\Parent1\parent.xlsx"
If you run my simple project over this document Aspose is returning:
"C:\_Work\Toronto\Parent1\parent.xlsx"
Over https://support.microsoft.com/en-us/kb/328440 correct is path which was used when link was created which is in my case D drive and not C like reported by Aspose.Cells.
As we already observed the possible issue as you mentioned by using the following sample code with your template file. I found the ExternalLink returned wrong DataSource with extended path as you pointed out. Also, if I open the the document XML structure file: “xl\externalLinks_rels” I can see the Target attributes as: “/_Work/Toronto/Parent/parent.xlsx”.
We need to check if we could return similar string for ExternalLink.DataSource property? e.g Sample code:
Workbook workbook = new Workbook(@“E:\test2\externallinks\PDF\bin\Debug\child.xlsx”); for (int i = 0; i < workbook.Worksheets.ExternalLinks.Count; i++) {
I have logged a ticket with an id “CELLSNET-44402” for your issue. Our concerned developer from product team will evaluate your issue if we could fix it out as per your demand.
Once we have an update on it, we will let you know here.
Our product team has evaluated your issue in details. Currently, the value is same as displayed in MS Excel. We will add a new property to return stored data in the file for your requirements.
Once we implement this feature, we will let you know here.
thanks for this update. Do you have estimate when this will be provided? This will be get/set property, right? I'll need to make changes of this value :)
Btw. I think that problem is because Aspose.Cells does not work like Excel. If you check my previous comment you can see that in Excel you have D drive and when you access this value over Aspose.Cells C drive is returned.
I have logged your concerns against your issue “CELLSNET-44402” into our database. I have also asked the concerned developer from product team to consider your requirements (get/set external data source) fully (if possible). Furthermore, I have requested him to provide an ETA on the ticket.
Once we have an update on it, we will let you know here.
It is to update you that the ticket logged earlier as CELLSNET-44402 has been marked resolved. We will soon share the fixed version here after ensuring the quality and incorporating other enhancements and fixes.
Once the fix is available, we will share it here with details.
1) You are right, it returns: “_Work\Toronto\Parent\parent.xlsx” but in the document XML structure file: “xl\externalLinks_rels” we can see the Target attribute as:
“/_Work/Toronto/Parent/parent.xlsx”. I have reopened the issue. We will check if we could match with the XML structure as per your demand.
2) Well, you may try to set it by using ExternalLink.DataSource attribute. Let us know if you find any issue.
as DataSource also formats external link like new OriginalDataSource please either:
- change that both properties are returning same /
or
- leave as it is and then we can programmatically use what we need
If you correct only OriginalDataSource without adjusting DataSource will be difficult to figure what is really correct. Maybe better option is to leave it like it is in this version without any additional change.
Your concerns make sense. I have logged your suggestion(s) against your issue “CELLSNET-44402” into our database. Our concerned developer from product team will evaluate and look into it accordingly.
Once we have an update on it, we will let you know here.
I believe that bug CELLSNET-44402 is regression with Aspose.Cells 18.3.
In original file I have following external links:
Data Source: https:\\aspose.sharepoint.com\Fund I\LPs\LP Call Downs\Master Call Down Fund I.xlsx
Original Data Source:https://aspose.sharepoint.com/Fund I/LPs/LP Call Downs/Master Call Down Fund I.xlsx
After I just save this file to new file name (no changes done) my original data source is changed to https:\\aspose.sharepoint.com\Fund I\LPs\LP Call Downs\Master Call Down Fund I.xlsx
Again / is replaced with . Can you please check?
Sample project is attached.