//create a new workbook var workbook = new GrapeCity.Documents.Excel.Workbook(); // Load template file FlowChartsFile.xlsx from resource var fileStream = this.GetResourceStream("xlsx\\FlowChartsFile.xlsx"); workbook.Open(fileStream); // Copy the selected sheets to the end of current workbook workbook.Worksheets[new string[] { "FlowChart1", "FlowChart2" }].Copy(); // Save to an excel file workbook.Save("CopyMultipleWorksheets.xlsx");
' Create a new Workbook Dim workbook As New Workbook ' Load template file FlowChartsFile.xlsx from resource Dim fileStream = Me.GetResourceStream("xlsx\FlowChartsFile.xlsx") workbook.Open(fileStream) ' Copy the selected sheets to the end of current workbook workbook.Worksheets(New String() {"FlowChart1", "FlowChart2"}).Copy() ' save to an excel file workbook.Save("CopyMultipleWorksheets.xlsx")