close method on the workbook.

close method on the workbook.

Previous Home Next

 

how to close() method  on  the workbook.

As described earlier for workbook we have to import the jxl.write.WritableWorkbook class.
 For creating a workbook we have to create a workbook as,
WritableWorkbook workbook = Workbook.createWorkbook(new File);
WritableSheet sht=workbook.createSheet("mysheet", 0);

/* code for adding some data to spreadsheet */
 workbook.write();       // write all the data to workbook
workbook.close();       // close the instance of the current workbook.

The close() method closes the workbook and makes the memory that have been allocated available for the garbage collection.



 

Previous Home Next