Damaged file handling
You could try using HSSFWorkbook to open .xls files. You could use the following code to check how POI respond determining xls format. private boolean isExcel(InputStream i) throws IOException { return (POIFSFileSystem.hasPOIFSHeader(i) || POIXMLDocument.hasOOXMLHeader(i)); } I would use : InputStream input = new FileInputStream(fileName); Instead of : File file = new File(“Z:\\Path\\To\\File_causing_the_trouble.xls”); Did you check … Read more