You are on page 1of 1

HSSFWorkbook workbook = new HSSFWorkbook(fileInputStream); // for each sheet in the workbook for (int i = 0; i < workbook.getNumberOfSheets(); i++) { System.out.

println("Sheet name: " + workbook.getSheetName(i) ); } } catch (IOException e) { e.printStackTrace(); } finally { if (fileInputStream != null) { try { fileInputStream.close(); } catch (IOException e) { e.printStackTrace(); } } } } } try { //... throw new IndexOutOfBoundsException("If you want a message, put it here"); } catch (IndexOutOfBoundsException e) { System.out.println(e.getMessage()); } System.out.println(workbook03.getSheetName(i)+"======"+nsheet);

You might also like