Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Sometimes, you need to copy elements in a worksheet, for example pictures, charts, and other drawing objects, between worksheets. Aspose.Cells supports this feature. Charts, images, and other objects can be copied with the highest degree of precision.
This article gives you a detailed understanding of how to copy shapes between worksheets. To illustrate, it creates a console application in Visual Studio .NET, copies pictures, charts, and other drawing objects between worksheets using Aspose.Cells.
Below is the code for copying a chart from one worksheet to another
C#
string FilePath = @"..\..\..\Sample Files\";
string FileName = FilePath + "Copy Shapes between Worksheets.xlsx";
// Open the template file
Workbook workbook = new Workbook(FileName);
// Get the Chart from the "Chart" worksheet.
Aspose.Cells.Charts.Chart source = workbook.Worksheets["Chart"].Charts[0];
Aspose.Cells.Drawing.ChartShape cshape = source.ChartObject;
// Copy the Chart to the Result worksheet
workbook.Worksheets["Result"].Shapes.AddCopy(cshape, 20, 0, 2, 0);
// Save the workbook
workbook.Save(FileName);
Note: For more details about copying multiple shapes, you need to visit here
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.