Formula not updated

Hi

I have a formula in cell C23.

I insert a column before the column C and the formula in C23 (Sum(C12:C21)) is not updated at the same time. I guess it's updated only when I save the workbook since the formula is correct when I open the workbook with Excel.

The problem is before saving the workbook, I need to copy the row 23 on another worksheet with the function Cells.CopyRow and after that I save the workbook. But when I do this, the formula is not updated even when I open the workbook with Excel.

Thank you

Alexandre

Hi Alexandre,

I cannot reproduce your problem in my machine. Which version of Aspose.Cells are you using? Please try the fix at

Aspose.Cells Downloads

If it still doesn’t work, please post a simple console project to show your problem. Thank you very much.

Aspose.Cells.Workbook w = new Workbook();

w.Open("C:\\rapport.xls");

Aspose.Cells.Worksheet s = w.Worksheets[0];

Aspose.Cells.Worksheet s2 = w.Worksheets[1];

s.Cells.InsertColumn(0,true);

for(int i = 0; i < 50; ++i)

{

s2.Cells.CopyRow(s.Cells,i,i);

}

w.Save("C:\\rapport2.xls");

Thank you. We will check and fix it soon.

I tried your code and it still worked fine. Please check this attached output file.

By the way, could you please try the new fix at

Aspose.Cells Downloads

to see if it works for this problem.

I tried with the fix.

With the code I wrote before, it works in release mode but not in debug.

But if I use this code in a windows application

Aspose.Cells.Workbook w = new Workbook();

w.Open("C:\\rapport.xls");

Aspose.Cells.Worksheet s = w.Worksheets[0];

Aspose.Cells.Worksheet s2 = w.Worksheets[1];

MessageBox.Show(s.Cells["C23"].Formula);

s.Cells.InsertColumn(0,true);

MessageBox.Show(s.Cells["D23"].Formula);

for(int i = 0; i < 50; ++i)

{

s2.Cells.CopyRow(s.Cells,i,i);

}

w.Save("C:\\rapport2.xls");

It doesn't work even in release mode, the formula in D23 is not updated.

If I comment out the first message box, it works.

Even with a console application where I replace the message box with a console.writeline, I have the same problem.

Thank you

Alexandre

Hi Alexandre,

I tried your code (with message boxes) using your template file, the output file (attached) is fine and rows are copied fine with updated formulas in the second sheet. I tried both in Debug and Release mode, it 's ok.

It looks very strange to us that the rows are not getting copied with updated formulas on your side.

Could you try it on some other machine. And which OS, .Net Framework you are using?

Thank you.

Hi Amjad

I tested with 3 different computers

My computer... Windows XP Pro French
Windows 2003 Standard French
Windows 2003 Standard English

All with the framework 1.1.4322

Thank you

I think this problem is caused by that your application is not using the new fix. Could you please zip and post your project here? Thank you.

I downloaded the fix again and it's fixed. I don't know why, I downloaded the fix twice friday and it was not the same version than I downloaded this morning.

Thank you.