//For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-C //Source directory path StringPtr srcDir = new String("..\\Data\\01_SourceDirectory\\"); //Output directory path StringPtr outDir = new String("..\\Data\\02_OutputDirectory\\"); //Path of input excel file StringPtr sampleCopyingAndMovingWorksheets = srcDir->StringAppend(new String("sampleCopyingAndMovingWorksheets.xlsx")); //Path of output excel file StringPtr outputCopyingAndMovingWorksheets = outDir->StringAppend(new String("outputCopyingAndMovingWorksheets.xlsx")); //Create workbook intrusive_ptr workbook = Factory::CreateIWorkbook(sampleCopyingAndMovingWorksheets); //Create worksheets object with reference to the sheets of the workbook. intrusive_ptr sheets = workbook->GetIWorksheets(); //Copy data to a new sheet from an existing sheet within the workbook. sheets->AddCopy(new String("Test1")); //Save the Excel file. workbook->Save(outputCopyingAndMovingWorksheets); StringPtr msg = new String("Worksheet copied successfully with in a workbook!"); Console::WriteLine(msg);