POI创建EXCEL文档

前言

本篇主要是创建一个EXCEL文档。

public static void main(String[] args)throws Exception
{
  //定义一个工作簿
  Workbook wb = new HSSFWorkbook();
  //输出流
  FileOutputStream fileout = new FileOutputStream("f:\\poi\\poi.xlsx");
  //写出
  wb.write(fileout);
  //关闭流
  fileout.close();
}

总结:如果文件创建在C盘,可能会因为权限不够,无法创建。

猜你喜欢

转载自blog.csdn.net/a4171175/article/details/80012667