我编写了用于编写xlsm的java文件(Excel 2007).
使用Apache POI库,编写xlsx文件是成功的.编写xlsm文件是成功的.但是由于打开xlsm文件时出错,我无法打开xlsm文件.
使用Apache POI Library编写xlsm文件是否可行?
如果编写xlsm是可行的,请提供指导如何使用Apache poi库编写xlsm文件.
XSSFWorkbook workBook = new XSSFWorkbook();
XSSFSheet sheet = workBook.createSheet("Related_SRC");
String realName = "Test.xlsm";
File file = new File("C:\\sdpApp", realName);
try {
FileOutputStream fileOutput = new FileOutputStream(file);
workBook.write(fileOutput);
fileOutput.close();
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}
谢谢