I think that you need to write protect the workbook as well. As I understand the process, you need to call the sheet.protectSheet() method on each sheet in the workbook and then the workbook.writeProtectWorkbook(java.lang.String password, java.lang.String username) which, to quote the javadoc, "protect a workbook with a password (not encypted, just sets writeprotect flags and the password."
alamu wrote: > > Thank you so much for the response, Nick. > > This is the requirement and having problems in implementation. > > 1. Copy worksheet from one workbook to another workbook(including format, > font etc)? > 2. After the workbook is copied over, the sheet should be made readonly. > (write protected). > > I've tried different things for the above 2 features. > > a. Got the code from the following ((using only few methods - POI) to copy > sheet from one workbook to another. > http://jxls.cvs.sourceforge.net/jxls/jxls/src/java/org/jxls/util/Util.java?view=markup > > b. After copying sheets, called sheet.protectSheet method. > > Feature a) works but not the feature b) > > Questions: > a. For the above, what version of the POI should be used? > b. Can someone please let me know if the above features are supported with > POI? If so, can someone please provide some sample code? > > Please let me know if you have questions on the above. Any help is much > appreciated. > > -- View this message in context: http://www.nabble.com/setCellStyle-%28HSSFStyle%29-in-poi-3.2-FINAL-20081019.jar-throws-exception-tp23198948p23229246.html Sent from the POI - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
