Return Value
A new XLSheet object with the same contents and formatting as this sheet.
After cloning a sheet, you must rename it and then add it to the book (duplicate names are not allowed).
This method is useful for applications that generate books with a large number of similar sheets.
// load book with template sheet _c1xl.Load(@"c:\temp\template.xls"); // create 12 copies of the template sheet XLSheet templateSheet = _c1xl.Sheets["Template"]; for (int month = 1; month <= 12; month++) { XLSheet newSheet = templateSheet.Clone(); newSheet.Name = month.ToString(); // rename clone newSheet[0,0].Value = month; // make changes _c1xl.Sheets.Add(newSheet); // add clone to book } // remove the template sheet and save with new name _c1xl.Sheets.Remove("Template"); _c1xl.Save(@"C:\temp\expense_report.xls");