Hello- please send me a email about the question- thanks william101.hu@gmail.com

Hello, please send me a email about the question, thanks william101.hu@gmail.com

Hi William,

Thanks for your posting and using Aspose.Cells.

You will get the email notification automatically whenever we reply your message.

For your question about worksheet.Cells.CopyRow() please use Range.Copy() instead. It will copy your entire range to your destination range including formulas.

As an example, please see the following code. It copies range A1:G15 to
a destination range starting from cell I4. As you can see in the
screenshot, it copies everything in this range to destination range. It
copies comments, hyperlinks, formatted table, picture and shapes.

Similarly, you can copy your desired range into another worksheet or another workbook.

I have attached the source xlsx file used in this code and output xlsx file generated by it for your reference.

If you have any other question, please feel free to post on this forum, we will look into it and help you asap.

C#


//Load the source workbook

Workbook workbook = new Workbook(“source.xlsx”);


//Access the first worksheet

Worksheet worksheet = workbook.Worksheets[0];


//Source range to be copied

Range sourceRange = worksheet.Cells.CreateRange(“A1:G15”);


//Destination range, where source range to be copied.

Cell startCell = worksheet.Cells[“I4”];

Range destRange = worksheet.Cells.CreateRange(startCell.Row, startCell.Column, sourceRange.RowCount, sourceRange.ColumnCount);


//Copy source range to destination range

//It will copy hyperlinks, comments, formattings, shapes, pictures etc

destRange.Copy(sourceRange);


//Save the output

workbook.Save(“output.xlsx”);


Well done! Thanks.