Although I have Sheet at index 0 It throws Exception

186
February 11, 2018, at 09:23 AM

I wrote that code 3 days Ago and It was working but Today It throws java.lang.IllegalArgumentException: Sheet index (0) is out of range (no sheets) Exception at line 5 that has HSSFSheet though I have 2 Sheet at workbook.I searched and reimported Apache POI but nothing worked

File file = new File("C:\\Users\\Ferhat\\IdeaProjects\\untitled6\\Test.xls  ");
    FileInputStream fileInputStream = new FileInputStream(file);
    HSSFWorkbook workbook = new HSSFWorkbook();
    HSSFSheet sheet = workbook.getSheetAt(0);
    Cell cell = null ;
    cell = sheet.getRow(2).getCell(1);
    cell.setCellValue("Cell Testing");
    fileInputStream.close();
    FileOutputStream fileOutputStream = new FileOutputStream(file);
    workbook.write(fileOutputStream);
    fileOutputStream.close();
Rent Charter Buses Company
READ ALSO
Processing JSP From Within Java Code

Processing JSP From Within Java Code

Does anyone know if it's possible to process a JSP page from within Java code and get the resulting HTML string?

217
Dropdown CSS selector in Selenium

Dropdown CSS selector in Selenium

I have the following page: http://liveguru99

320