Example: Count property

This example opens several spreadsheets and then displays the number of the opened spreadsheets.

try {
  Application application = Application.getInstance();
  Spreadsheets spreadsheets = application.getSpreadsheets();
  Spreadsheet spreadsheet = spreadsheets.openSpreadsheet("D:\\test.ods", true);
  Spreadsheet spreadsheet2 = spreadsheets.openSpreadsheet("D:\\test2.ods", true);
  Spreadsheet spreadsheet3 = spreadsheets.openSpreadsheet("D:\\test3.ods", true);
  System.out.println(spreadsheets.getCount());
} catch(Exception e) {
  e.printStackTrace();
}

Related information

Count property