import org.apache.poi.ss.usermodel.*;
workbook = WorkbookFactory.create(new FileInputStream("test1.xlsx"))
// シートの複製
sheet = workbook.cloneSheet(0)
workbook.getSheetAt(workbook.getActiveSheetIndex()).setSelected(false)
workbook.setActiveSheet(workbook.getSheetIndex(sheet))
workbook.write(new FileOutputStream("test9.xlsx"))
サンプルExcelブック(test1.xlsx)
出力Excel(test9.xlsx)
動作環境
groovy 1.7.0, JDK6 Update18, Apache POI 3.6
0 件のコメント:
コメントを投稿