import jxl.Workbook;
import jxl.read.biff.BiffException;
import jxl.write.*;
import java.io.File;
import java.io.IOException;
public class testExcel {
public static void main(String[] args) throws IOException, BiffException, WriteException {
File file = new File("D:\\testE.xls");
WritableWorkbook workbook = Workbook.createWorkbook(file);
WritableSheet s = workbook.createSheet("Sheet1", 0);
WritableFont wf = new WritableFont(WritableFont.ARIAL, 10, WritableFont.BOLD);
WritableCellFormat cf = new WritableCellFormat(wf);
Label l = new Label(0, 0, "new", cf);
s.addCell(l);
workbook.write();
workbook.close();
}
}
然后创建一个新文档,但我需要打开一个现有文档并更改一些单元格