下载地址:
http://poi.apache.org/download.html#POI-3.9
Binary Distribution:
使用两个jar包:poi-ooxml-3.9-20121203.jar, poi-3.9-20121203.jar
InputStream inp = new FileInputStream("wb.xls");
WorkbookFactory WorkbookFactory=new WorkbookFactory();
Workbook wb = WorkbookFactory.create(inp);
Sheet sheet = wb.getSheetAt(0);
Row row = sheet.createRow((short)6);
row.createCell(0).setCellValue(1.1);
row.createCell(1).setCellValue(new Date());
row.createCell(2).setCellValue(Calendar.getInstance());
row.createCell(3).setCellValue("a string");
row.createCell(4).setCellValue(true);
row.createCell(5).setCellType(Cell.CELL_TYPE_ERROR);
FileOutputStream fileOut = new FileOutputStream("wb.xls");
wb.write(fileOut);
fileOut.close();
原文地址:http://stackoverflow.com/questions/521274/edit-existing-excel-files-using-jxl-api-apache-poi