none
Dupilcate excel sheet openxml RRS feed

Answers

  • >>>How to duplicate excel sheet using c# AND OPENXML?

    According to your description, you could refer to this article about How to Copy a Worksheet within a Workbook

    In addition I suggest that you could install Open XML SDK 2.5 Productivity Tool.

    The Open XML SDK 2.5 Productivity Tool for Microsoft Office provides a number of features designed to improve your productivity and accelerate your learning while working with the SDK and Open XML files. Features include the ability to generate Open XML SDK 2.5 source code based on document content, compare source and target Open XML documents to reveal differences and to generate source code to create the target from the source, validate documents, and display documentation for the Open XML SDK 2.5 Classes, the ECMA376v1 standard, and the Microsoft Office implementation notes. 

    Thanks for your understanding.
    • Proposed as answer by David_JunFeng Friday, September 30, 2016 5:33 AM
    • Marked as answer by David_JunFeng Wednesday, October 5, 2016 1:38 PM
    Tuesday, September 27, 2016 3:17 AM
  • Workbook workbook = new Workbook();
    workbook.LoadFromFile(@"C:\Users\Administrator\Desktop\sample.xlsx");
    //get the sheet that you want to copy
    Worksheet sheet1 = workbook.Worksheets[0];
    //add a new sheet and name it
    workbook.Worksheets.Add("copy of sheet1");
    //copy sheet1 to new sheet
    workbook.Worksheets[1].CopyFrom(sheet1);
    workbook.SaveToFile("Duplicated.xlsx",ExcelVersion.Version2013);
    

    This solution is based on free .NET Excel component.
    • Proposed as answer by David_JunFeng Friday, September 30, 2016 5:33 AM
    • Marked as answer by David_JunFeng Wednesday, October 5, 2016 1:38 PM
    Wednesday, September 28, 2016 3:36 AM

All replies

  • >>>How to duplicate excel sheet using c# AND OPENXML?

    According to your description, you could refer to this article about How to Copy a Worksheet within a Workbook

    In addition I suggest that you could install Open XML SDK 2.5 Productivity Tool.

    The Open XML SDK 2.5 Productivity Tool for Microsoft Office provides a number of features designed to improve your productivity and accelerate your learning while working with the SDK and Open XML files. Features include the ability to generate Open XML SDK 2.5 source code based on document content, compare source and target Open XML documents to reveal differences and to generate source code to create the target from the source, validate documents, and display documentation for the Open XML SDK 2.5 Classes, the ECMA376v1 standard, and the Microsoft Office implementation notes. 

    Thanks for your understanding.
    • Proposed as answer by David_JunFeng Friday, September 30, 2016 5:33 AM
    • Marked as answer by David_JunFeng Wednesday, October 5, 2016 1:38 PM
    Tuesday, September 27, 2016 3:17 AM
  • Workbook workbook = new Workbook();
    workbook.LoadFromFile(@"C:\Users\Administrator\Desktop\sample.xlsx");
    //get the sheet that you want to copy
    Worksheet sheet1 = workbook.Worksheets[0];
    //add a new sheet and name it
    workbook.Worksheets.Add("copy of sheet1");
    //copy sheet1 to new sheet
    workbook.Worksheets[1].CopyFrom(sheet1);
    workbook.SaveToFile("Duplicated.xlsx",ExcelVersion.Version2013);
    

    This solution is based on free .NET Excel component.
    • Proposed as answer by David_JunFeng Friday, September 30, 2016 5:33 AM
    • Marked as answer by David_JunFeng Wednesday, October 5, 2016 1:38 PM
    Wednesday, September 28, 2016 3:36 AM