Question regarding UpdateLinkedDataSource

Hello:

I can't seem to get UpdateLinkedDataSource to work. If I change a value in shapes source.xlsx, the new value should be reflected in shapes dest.xlsx, however it never gets updated.

//this workbook has an external reference to "D:\\test\\shapes source.xlsx"
Workbook wb = new Workbook("D:\\test\\shapes dest.xlsx");

Workbook wbSrc = new Workbook("D:\\test\\shapes source.xlsx");

wbSrc.CalculateFormula();
wb.UpdateLinkedDataSource(new Workbook[] {wbSrc});
wb.CalculateFormula();

wb.Save("D:\\test\\shapes dest2.xlsx");

Please help with the syntax.

Thanks,

Mark


Hi,

Please post your template files here, also point out which value you are changing (in which cell) and where the formulas are not getting calculated in the file? We will check your issue soon.

Thank you.

HI
Please follow the following code to get changes in the linked file.
Issue: Destination file name was not correct.

=======================
//this workbook has an external reference to “D:\test\shapes source.xlsx”

Workbook wb = new Workbook(“D:\test\shapes dest.xlsx”);
Workbook wbSrc = new Workbook(“D:\test\shapes source.xlsx”);

wbSrc.CalculateFormula();
wb.UpdateLinkedDataSource(new Workbook[] {wbSrc});
wb.CalculateFormula();

//wb.Save(“D:\test\shapes dest2.xlsx”);
//use this line
wb.Save(“D:\test\shapes dest.xlsx”);
===================================


thanks

Thanks, but I still can't get it to work. I have attatched the two spreadsheets. The external reference is this:

='D:\test\[shapes source.xlsx]Sheet1'!$C$4:$C$9

Thanks very much.

Mark

Hi
can u please tell me which cell of the shapes dest.xlsx is referencing to
[shapes source.xlsx]Sheet1’!$C$4:$C$9.

I am unable to locate the reference in shapes dest.xlsx of shapes source.xlsx

Also if you are referencing in this way
[shapes source.xlsx]Sheet1’!$C$4:$C$9

, then it not the right way. It will produce the output like #VALUE! which is not right.

what you want to achieve?

thanks

If you click on the green area in shapes dest.xlsx, you will see the formula in the formula bar. (and the whole table area will be have a box around it with handles to resize/move.) This is a “picture” reference that was created with the camera tool.


“[shapes source.xlsx]Sheet1’!$C$4:$C$9” is the reference that was created by Excel using the camera tool.

It sounds like you may not support this kind of reference. If you don’t it would be a great addition!

Thanks.

Mark

hi
thanks for reply, I am unable to locate the green area in the shapes dest.xlsx can u please specify it. This workbook only have a value ‘dest’ in C9 cell. and nothing else…
please show me where it is…


I can see green area in shapes source.xlsx but that has values 9 and sum of these values…

Please let me know where u used this range in the shapes dest.xlsx
thanks

I have uploaded:

shapes source.xlsx, shapes dest.xlsx, a PDF of shapes.xlsx created with your software and a screenshot of shapes dest.xlsx.

Please look at the screenshot to see what I see.

I added a couple of more referenced areas to shapes dest.xlxs.

I am using Excel 2010.

You will see that there are three areas referencing the same range in shapes source.xlsx.

Thanks.

Mark

Salman:

I just wanted to check back with you to see if you have any more information regarding my issue. I need to be sure that this works before purchasing.

Thanks,

Mark

Hi Mark,

The issue has been fixed. Please find the updates Aspose.Cells5.1.1.2.dll attached.

Thanks,

Thanks for the fix. However I have a problem. I am getting a compile error with the new dll.

I copied it to "D:\Program Files\Aspose\Aspose.Cells for .NET\Bin\net3.5_ClientProfile".

I removed the reference from my C# project and added it again. Now when I compile I get an error.

I did get past the compile error.

I had to change the "Target Framework" to ".NET Framework 4" from ".NET Framework 4 Client Profile".

However, the original problem is still there. The spreadsheet is not being updated.

Thanks.

Mark