如何使用Java创建空白Excel工作表。
以下是使用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");
}
}