How to check if xlsx file is password protected or not. we can check for xls file as follows
FileInputStream fin = new FileInputStream(new File(\"C:/Book1.xl
Try using
XSSFWorkbook wb = new XSSFWorkbook(dataStream);
From Apache POI: "HSSF is the POI Project's pure Java implementation of the Excel '97(-2007) file format. XSSF is the POI Project's pure Java implementation of the Excel 2007 OOXML (.xlsx) file format." http://poi.apache.org/spreadsheet/ You're using the HSSF (which will work for xls) on a XLSX file.