//create a new workbook var workbook = new GrapeCity.Documents.Excel.Workbook(); //Load template file AgingReport.xlsx from resource var fileStream = this.GetResourceStream("xlsx\\AgingReport.xlsx"); workbook.Open(fileStream); //Copy the active sheet to the end of current workbook var copy_worksheet = workbook.ActiveSheet.Copy(); copy_worksheet.Name = "Copy of " + workbook.ActiveSheet.Name; // Save to an excel file workbook.Save("CopyWorksheet.xlsx");
' Create a new Workbook Dim workbook As New Workbook 'Load template file AgingReport.xlsx from resource Dim fileStream = GetResourceStream("AgingReport.xlsx") workbook.Open(fileStream) 'Copy the active sheet to the end of current workbook Dim copy_worksheet = workbook.ActiveSheet.Copy() copy_worksheet.Name = "Copy of " & workbook.ActiveSheet.Name ' save to an excel file workbook.Save("CopyWorksheet.xlsx")