Example: ActiveSpreadsheet property

This example closes the active spreadsheet without save changes.

 try {
  Application application = Application.getInstance();
  application.getSpreadsheets().openSpreadsheet("D:\\FileTypeAssociation\\test.ods", true);
  Spreadsheet spreadsheet = application.getActiveSpreadsheet();
  spreadsheet.closeSpreadsheet(false);
 } catch(Exception e) {
   e.printStackTrace();
 }

Related information

ActiveSpreadsheet property