我正在尝试使用apache POI for java在现有excel工作簿中创建一个新工作表,但到目前为止还没有成功.谁能告诉我它是如何完成的?
这很容易.就像在新工作簿中添加新工作表一样,只需从现有工作簿开始,而不是从新工作簿开始
Workbook wb = WorkbookFactory.create(new File("/path/to/existing"));
Sheet s = wb.createSheet();
// Do something with the new sheet
FileOutputStream out = new FileOutputStream("/path/to/new/version");
wb.write(out);
out.close();
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
23283 次 |
| 最近记录: |