Example: Count property

This example displays the count of the sheets in a spreadsheet.

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

Related information

Count property