Search code examples
javaapacheapache-poixssf

How to get the position/index of a Sheet object in Java Apache POI


In a Java method, I am using an Apache POI Sheet (from XSSFWorkbook). I can read the sheet name using getSheetName() method. But is there any way to find the sheet position in the workbook? I don't see any methods like getSheetIndex() in the Sheet interface.


Solution

  • Not in Sheet interface but Workbook has one method to do that :

    Workbook.getSheetIndex(String name);