Free Support Forum - aspose.com

Cells.CopyRow() Problem

Hello.

I am using Aspose.Cells 4.4.1.14 (and .NET 2.0).
The problem doesn't happen when I use version of Aspose.Cells 4.3.0.3.

The problem happens when Row is copied from 'Sheet2' to 'Sheet1' by Cells.CopyRows().
(The problem doesn't happen when Row is copied in the same Sheet.)

The minimum code is below
------------------------------------------------------------------------------------------
Workbook workbook = new Workbook();
string FilePath = "C:\\AsposeTest\\TEST.xls";
workbook.Open(FilePath);

Worksheet worksheet1 = workbook.Worksheets[0];
Worksheet worksheet2 = workbook.Worksheets[1];
Cells cells = worksheet1.Cells;
Cells cells2 = worksheet2.Cells;

int row = 15;

// CopyRow from 'Sheet2' to 'Sheet1'
cells.CopyRow(cells2, cells2.Rows[row].Index, cells.Rows[row - 2].Index);
cells.CopyRow(cells2, cells2.Rows[row].Index, cells.Rows[row - 1].Index);
cells.CopyRow(cells2, cells2.Rows[row].Index, cells.Rows[row].Index);
cells.CopyRow(cells2, cells2.Rows[row].Index, cells.Rows[row + 1].Index);

// CopyRow in 'Sheet2'
cells2.CopyRow(cells2, cells2.Rows[row].Index, cells2.Rows[row - 2].Index);
cells2.CopyRow(cells2, cells2.Rows[row].Index, cells2.Rows[row - 1].Index);
cells2.CopyRow(cells2, cells2.Rows[row].Index, cells2.Rows[row + 1].Index);

workbook.Save("RESULT.xls", FileFormatType.Default, SaveType.OpenInExcel, Response);
------------------------------------------------------------------------------------------

Please investigate.
Can I get a hotfix?

Thank you.

Hi,

Thanks for the template file with sample code,

We found the issue as some data, formattings lost when copying rows from one sheet to other. We will provide a fix soon.

Thank you.

Hi,

Please try this fix.

Hello.

Thank you for your quick help.
I tested the fix, and I confirmed the problem was fixed.

Thank you.