Using Java Excel APIs we can create, format Excel files.
Problem:-
Protect Excel files using Java.
Solution:-
JExcelUtil will help users to protect workbooks using Java.
JExcelUtil lets you to set the password to Excel Files using Java. If the file is already password protected then by passing old password and new password you can change the password.
To Download
http://jexcelutil.sourceforge.net/
Ready to Go
ü Download JExcelUtil.jar.
ü Put this JAR file in your classpath.
ü Download ExcelUtilDemo java file.
ü Run this ExcelUtilDemo java program.
Examples:-
Create an object of ExcelAdapter class
ExcelAdapter objExcelAdapter = new ExcelAdapter();
//Set the password using
objExcelAdapter.setPasswordXlsFile("mytestfile.xls", "myPassword");
// if file is already pwd protected use this one 2nd parameter is
objExcelAdapter.setPasswordXlsFile("mytestfile.xls", "oldPassword",
"newPassword");
Another Example:-
Run ExcelUtilDemo program using
java -cp JExcelUtil.jar;.; ExcelUtilDemo fileName [oldPassword] newPassword
Subscribe to:
Post Comments (Atom)
Hi
ReplyDeleteThis somehow does not work on unix manchine, i m getting an error java.io.IOException: cmd: not found
limitation of this API is that it works on windows platform.
Delete