Free Support Forum - aspose.com

Merged Cells are not copied to new row

I’m using the following code to copy the style of one cell to
another. I’m assuming that merged status is part of style and not
contents:



exlTargetCell.Style.Copy(exlCell.Style)



If exlCell is in column A and merged with B, then exlTargetCell will not reflect the merge.




Merged status is not a property of a single cell. You can verify it in MS Excel:

1. Select a single cell

2. Format the cell and select the merged cell option

You will see it will not take effect.

Please use Cells.CopyRow method to copy a whole row. You can see the merged cells will be copied correctly.