Related Article(s):
Last active
August 10, 2023 12:20
-
-
Save GroupDocsGists/16392e538015b460a7948ab549efdf56 to your computer and use it in GitHub Desktop.
Protection of Excel Spreadsheets by Adding, Removing, and Changing Password using Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Update password of the protected spreadsheet files using Java | |
*/ | |
LoadOptions loadOptions = new LoadOptions("mySECRETpassWORD"); | |
UpdatePasswordOptions updateOptions = new UpdatePasswordOptions("TOPSECRET_pa22WORD"); | |
Merger merger = new Merger("path/protected-spreadsheet.xlsx", loadOptions); | |
merger.updatePassword(updateOptions); | |
merger.save("path/pwd-changed-spreadsheet.xlsx"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Password Protect Excel Spreadsheets using Java | |
*/ | |
AddPasswordOptions addOptions = new AddPasswordOptions("mySECRETpassWORD"); | |
Merger merger = new Merger("path/spreadsheet.xlsx"); | |
merger.addPassword(addOptions); | |
merger.save("path/protected-spreadsheet.xlsx"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Remove password from Excel Spreadsheet files using Java | |
*/ | |
LoadOptions loadOptions = new LoadOptions("mySECRETpassWORD"); | |
Merger merger = new Merger("path/protected-spreadsheet.xlsx", loadOptions); | |
merger.removePassword(); | |
merger.save("path/unlocked-spreadsheet.xlsx"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment