How can I programmatically check if a workbook of an excel file is password protected? If protected, how can I read and edit it using jxl?
For background, I wanted to make a file password protected but could not find a method to do it using jxl so I used com.jexcel.util.ExcelAdapter
. That set a password on excel file,but I could not find a way to unprotect file for reading and editing.
Using jxl if I set a password on sheet then I can read it but I do not know how to set password on workbook and how to unlock the password. There is that method isProtected()
that just tells that it is protected but I am unsure how to unlock and open it.