POIでExcel

やったー!VBAとおさらばだー。

user=> (import '(org.apache.poi.hssf.usermodel HSSFSheet HSSFWorkbook HSSFRow HSSFCell))
org.apache.poi.hssf.usermodel.HSSFCell
user=> (def wb (new HSSFWorkbook))
#'user/wb
user=> (import '(java.io FileOutputStream))
java.io.FileOutputStream
user=> (def fileOut (new FileOutputStream "c:\\PoiSampleBook.xls"))
#'user/fileOut
user=> (def sheet1 (.createSheet wb))
#'user/sheet1
user=> (def sheet2 (.createSheet wb))
#'user/sheet2
user=> (.setSheetName wb 0 "ggg")
nil
user=> (def row2 (.createRow sheet1 1))
#'user/row2
user=> (def cellB2 (.createCell row2 1))
#'user/cellB2
user=> (def cellC2 (.createCell row2 2))
#'user/cellC2
user=> (.setCellValue cellB2 "B2")
nil
user=> (.write wb fileOut)
nil
user=> (.close fileOut)
nil