I need to copy a sheet from one book to another. I am trying to use the code below, but it does not work:
ISheet newSheet = wb.GetSheetAt(0).CopySheet("WeeklyReport"); string filePath = "billing_template2.xlsx"; XSSFWorkbook billingWorkbook; using (var fs = new FileStream(filePath, FileMode.Open, FileAccess.Read)) { billingWorkbook = new XSSFWorkbook(fs); } billingWorkbook.Add(newSheet);
where wb is the source book and billingWorkbook is my workbook.
Note. My destination book already has a worksheet. I need to add the copied sheet after that.
source share