解决方案
以下是使用 Java 创建空白 Excel 工作表的程序。
import java.io.*;
import org.apache.poi.xssf.usermodel.*;
public class CreateBlankExcel {
public static void main(String[] args)throws Exception {
//Create Blank workbook
XSSFWorkbook workbook = new XSSFWorkbook();
//Create file system using specific name
FileOutputStream out = new FileOutputStream(
new File("C:/poiexcel/createBlankWorkBook.xlsx"));
//write operation workbook using file out object
workbook.write(out);
out.close();
System.out.println("createworkbook.xlsx written successfully");
}
}