SH
Steve Hookway
April 21, 2009 02:59 PM UTC
adding the following lines seem to do the trick:
IRange newRange = sheet.Range[row, col, lastRow, lastCol];
range.CopyTo(newRange, ExcelCopyRangeOptions.All);
newRange.ColumnWidth = range.ColumnWidth;
newRange.RowHeight = range.RowHeight;
I thought ExcelCopyRangeOptions.All would also preserve the spacing. Are there any other values that I should explicitly add to my new range?
GM
Geetha M
Syncfusion Team
April 22, 2009 12:22 PM UTC
Hi Steve,
Excel Range copy method does not copies row / column width / height. The above code copies all the data, formulas, styles and formatting (if any).
Please let me know if you have any questions.
Regards,
Geetha