Free Support Forum - aspose.com

No changes saved in XLS file (LinkSource update)

Hi Aspose team,

in attached project

XLS_NoUpdate.zip (97.1 KB)

you will find simple project that is reading one XLS document and showing all Link Sources (Data Connection), making change of SourceFile from c: to d:, saving output file and reading content of output file.

Now, when you run example you will see that source file has C: and output file has D: but when you open created document and go to Data => Connections => Definition of one of connections there still you can find C: so no update is shown. On the other side Aspose.Cells is returning D:.

Same example with newer Excel formats works.

Can you please check why changes are not updated in the document and provide solution?

Thanks,
Oliver

@dr.doc,

Thanks for the sample project, template file and details.

After an initial test, I am able to reproduce the issue as you mentioned by using your sample project with your template file. I found link sources are not updated in the output XLS file although at runtime we get correct updated path for external links/sources. I have logged a ticket with an id “CELLSNET-46905” for your issue. We will look into it soon.

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

@dr.doc,
If the connection is data source of QueryTable, MS Excel saves some duplicate data to .xls file and some records of QueryTable are not supported to parse now. We hope we can fix this issue in Q4 2019.

@dr.doc,

This is to inform you that we have fixed your issue now. We will soon provide you the fixed version after performing QA and incorporating other enhancements and fixes.

Hi Amjad,

any estimate when this release will be published?

Thx,
Oliver

@dr.doc,

Could you try our latest version/fix: Aspose.Cells for .NET v19.10.3 (attached)
if it fixes the issue.

Let us know your feedback.
Aspose.Cells19.10.3 For .Net2_AuthenticodeSigned.Zip (5.0 MB)
Aspose.Cells19.10.3 For .Net4.0.Zip (5.0 MB)

Hi Amjad,

thanks for this version. I can confirm that “Source File” is now updated but I noticed that Connection Info is not. Can you please reopen this issue to complete fixture of “Connection Info” also?

Here is the project where I am first making replacements and then reading

            Console.WriteLine("Connection Name: " + connection.Name);
            Console.WriteLine("Connection Info: " + connection.ConnectionInfo);
            Console.WriteLine("Source File: " + connection.SourceFile);
            Console.WriteLine("Command: " + connection.Command);

Sorry for missing this part before.

XLS_NoUpdate_2.zip (32.9 KB)

Thanks,
Oliver

@dr.doc,
We are glad to know that your actual issue is resolved. We have reopened this ticket to check the connection info string as well. We will write back here once any feedback is ready to share in this regard.

@dr.doc,
Please try the following codes with Aspose.Cells for .NET 19.10.4 version.

Aspose.Cells19.10.4 For .Net2_AuthenticodeSigned.Zip (5.0 MB)
Aspose.Cells19.10.4 For .Net4.0.Zip (5.0 MB)

Aspose.Cells.ExternalConnections.ExternalConnectionCollection connections = workbook.DataConnections;

        foreach (Aspose.Cells.ExternalConnections.DBConnection connection in connections)
        {
            connection.Name = connection.Name.Replace("c:\\", "d:\\");
            connection.SourceFile = connection.SourceFile.Replace("c:\\", "d:\\");
            connection.ConnectionInfo = connection.ConnectionInfo.Replace("c:\\", "d:\\").Replace("C:\\", "d:\\");
            connection.Command = connection.Command.Replace("c:\\", "d:\\");
            if (!string.IsNullOrEmpty(connection.SeverCommand))
                connection.SeverCommand = connection.SeverCommand.Replace("c:\\", "d:\\");
        } 

Let us know your feedback.

Hi,

I can confirm that it is working now. I also noticed that I tried to change c: where in string I had C:. Anyway, we can close this ticket now.

Thx,
Oliver

@dr.doc,

Good to know that your issue is sorted out completely now. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.

The issues you have found earlier (filed as CELLSNET-46905) have been fixed in Aspose.Cells for .NET v19.11. This message was posted using Bugs notification tool by Amjad_Sahi