Free Support Forum - aspose.com

Choose Function not evaluating correctly after inserting rows

I have a very simple Excel sheet with data in cells A1 through A4. In cell A5 I have a formula that uses the Choose function. The first parameter points to cell A1, the second one to A2 and so on.

=Choose(A1,A2,A3,A4)

When I insert 2 rows between A2 and A3, I expected the formula to be adjusted.

=Choose(A1,A2,A5,A6)

However, the formula does not get adjusted. It stays the same.

=Choose(A1,A2,A3,A4)

I have attached the sample worksheet.

This is the code I am using for my tests.

var workbook = new Workbook();
workbook.Open(GetBinDirectoryInfo().Parent.Parent.FullName + @"\Templates\Choose.xls");
workbook.CalculateFormula(false);

var worksheet = workbook.Worksheets[0];
worksheet.Cells.InsertRows(2, 2);
Assert.AreEqual("=CHOOSE(A1,A2,A5,A6)", worksheet.Cells[“A7”].Formula);

Please let me know if you need any more information.

Thanks

Harry

Hi,

Thanks for providing us the sample code and file.

I have found the issue as you have mentioned. I have logged your issue into our issue tracking system with an id: CELLSNET-20152. We will figure your issue out soon.

Thank you.

Do you have an update on this issue?

Our client is anxiously waiting for a fix as they cannot go live without it.

Thanks

Harry Madjarian

Hi,

Unfortunately, the issue is not fixed yet. I have enhanced the priority level for the issue. We will get back to you soon.

Thank you.

Hi,

Please try the attached version. We have fixed the issue now.

Thank you.

The fix worked for with the code posted that I posted in the first post, however if I change the code to insert columns, it still breaks.

Below is the code I used to test the issue. I used the same xls I posted above.

var workbook = new Workbook();
workbook.Open(GetBinDirectoryInfo().Parent.Parent.FullName + @"\Templates\Choose.xls");
workbook.CalculateFormula(false);

var worksheet = workbook.Worksheets[0];
worksheet.Cells.InsertColumns(0, 2);
workbook.CalculateFormula(false);
Assert.AreEqual("=CHOOSE(C1,C2,C3,C4)", worksheet.Cells[“C5”].Formula);

Can this be fixed quickly?

Thanks

Harry

Hi,

Thanks for pointing it out.

We have found the issue regarding InsertColumns() method now. I have reopened the issue again and we will fix it soon.

Thank you.

Hi,

Please try the attached version v5.1.3.3 now, we have fixed the issue.

Thank you.

This fix appears to be working. I will continue to test and let you know if I have any problems.

Thanks

Harry

The issues you have found earlier (filed as 20152) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.