Forum Discussion
aaronpliu
Frequent Contributor
firstly, to ensure you import required package, as follows:
import org.apache.poi.ss.usermodel.Cell import org.apache.poi.ss.usermodel.Row import org.apache.poi.xssf.usermodel.XSSFSheet import org.apache.poi.xssf.usermodel.XSSFWorkbook
secondly, you'd better to use try...catch for any I/O operation, as like
try { FileOutputStream outputStream = new FileOutputStream(FILE_NAME) workbook.write(outputStream) workbook.close() } catch (FileNotFoundException e) { e.printStackTrace() } catch (IOException e) { e.printStackTrace() }
Olga_T
6 years agoSmartBear Alumni (Retired)
Hi all,
aaronpliu, HimanshuTayal, thank you for your time looking into this!
Jason1, did you manage to accomplish your task? If your question was answered, don't hesitate to mark the reply that helped you as a solution to this topic. You can do this by clicking the Accept as Solution button below the appropriate reply.
We are looking forward to hearing from you.