Free Support Forum - aspose.com

CopyRow Formula Problem

Sorry for the bad code but this is the only way I can simulate this problem at the moment.
I am sure there is a more straigt forward way of showing this but this example does show the problem.

After my .CopyRow command, I am saving the workbook by creating another instance first and copying the existing workbook.
The file that is saved has a forumla problem.

The formula in cell "A18" should be reading:
=CONCATENATE("MA: ",M17," ",N17," Tier:",Q17)

Instead, it is reading the orginal row numbers like this:
=CONCATENATE("MA: ",M9," ",N9," Tier:",Q9)

Here is a code sample and attached is an excel file I am using as a template.
I am using version 4.0.2.7.
This worked correctly in version 3.7.1.0

Workbook excelWorkbook0 = new Workbook();
excelWorkbook0.Open(@"C:\Template.xls");

Workbook excelWorkbook2 = new Workbook();
int intWS = excelWorkbook2.Worksheets.Add();
Worksheet ws2 = excelWorkbook2.Worksheets[intWS];

Workbook excelWorkbook1 = new Workbook();
excelWorkbook1.Copy(excelWorkbook0);
Worksheet ws1 = excelWorkbook1.Worksheets[0];

ws2.Copy(ws1);

ws2.Cells.CopyRow(ws1.Cells, 9, 17);

Workbook excelWorkbook3 = new Workbook();
excelWorkbook3.Copy(excelWorkbook2);
excelWorkbook3.Save(@"C:\Final.xls", FileFormatType.Default);

Please try this attached fix.

Thank you!

This problem has been corrected.