Using the .NET dll, the DSUM function will be broken if the range is in another sheet and uses a named cell.
For example if I have this formula in my excel file, in Sheet2 :
=DSUM(Sheet1!C2:cellName;Sheet1!F2;Sheet1!I2:I3)
After loading the workbook in .NET, the formula will be :
=DSUM(C2:cellName;Sheet1!F2;Sheet1!I2:I3)
So if we use a cellname, the reference to the first sheet has disapeared, resulting in an error. If I replace “cellName” by a standard adress “F6”, it works.
Have you ever came across that problem, I have not found anything in the forum, sorry if it has already been declared.
Hi,
Thanks for your posting and using Aspose.Cells.
Please provide your sample excel file with DSUM formula which you can create manually using Microsoft Excel and attach it here so that we could investigate this issue at our end and fix this issue in our future versions.
It will also be helpful if you could provide us some sample code or project replicating this issue.
Please also download and try the latest version: Aspose.Cells
for .NET v8.4.0.1 and see if it makes any difference for you.
Thanks for the quick reply, I joined an example file.
The code to test this is quite simple, I am using .NET :
Workbook workbook = new Workbook(“path to file”);
Worksheet worksheet = workbook.Worksheets[1];
MessageBox.Show(worksheet.Cells[“A1”].Formula.ToString());
The formula displayed will miss the reference to the first sheet, making the formula invalid.
Seems to me that the code parsing the DSUM formula is having trouble with named cell in the “range” parameter.
I just tried the 8.4.0.1 and the problem is still there.
I will be waiting for your return!
Carl
Hi,
Thanks for providing us template file.
I observed the issue as you mentioned. I found that the formula involving a Named range cell is not read fine and as per MS Excel. I am using the following sample code with your template file: e.g Sample code: Workbook workbook = new Workbook("e:\\test2\\DSUM_example.xlsx"); Worksheet worksheet = workbook.Worksheets[1]; Console.WriteLine(worksheet.Cells["A1"].Formula.ToString());//=DSUM(C2:namedCell,Sample1!F2,Sample1!I2:I3) instead of =DSUM(Sample1!C2:namedCell,Sample1!F2,Sample1!I2:I3)
I have logged a ticket with an id "CELLSNET-43515" for your issue. We will look into it to figure it out soon.
Thank you.
Hi,
Thanks for your using Aspose.Cells.
Please download and try the latest fix: Aspose.Cells for .NET v8.4.0.3 and let us know your feedback.
Hi,
Wow, you guys are good at this! Works like a charm now.
Well done, thanks a lot!
Hi,
Thanks for your feedback.
Good to know that it figures out your issue, we have closed your ticket 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.
Thank you.
The issues you have found earlier (filed as CELLSNET-43515) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.