jar:poi-3.16 InputStream in = new FileInputStream(new File("C:\Users\Downloads\6.xls")); Biff8EncryptionKey.setCurrentUserPassword("1111111111111111");//打开密码 Workbook wb = WorkbookFactory.create(in); Biff8EncryptionKey.setCurrentUserPassword("{}[]||'';;,><,/?");//设置打开密码 FileOutputStream fos = new FileOutputStream(new File("C:\Users\Downloads\result.xls")); wb.write(fos);
fos.close();