1

Hello I have made an Excel export with apache POI. This Excel sheet is protected and you can only change one column. I am wondering if there is a solution of the following problem:

I want the user to be able to delete the not needed rows in the excel. Is it somehow possible to mark the protected/read only rows as 'deletable'? So the user can delete the rows in the exported Excel sheet?

Any hint would help me even the hint, that it isn't possible to do the trick would be very helpful.

Thanks in advance!

F4k3d
  • 653
  • 1
  • 10
  • 29
  • this is about how to lock options in a sheet. http://stackoverflow.com/questions/14701322/apache-poi-how-to-protect-sheet-with-options maybe you can find something there. how is the sheet protected? did you code the protection? http://stackoverflow.com/questions/8502552/make-column-as-read-only-using-apache-poi – XtremeBaumer Jan 31 '17 at 07:16
  • Thanks for your help. I have protected the sheet with apache POI, in that way: sheet.protectSheet("password"). Yes I coded it. That was the only way to make the rows read only, except one column! – F4k3d Jan 31 '17 at 07:20
  • No, that is what I have already done. The excel sheet is protected and only one column is changable. I am trying to make all rows, even with the readOnly Columns deletable, so the user can delte the not needed rows. – F4k3d Jan 31 '17 at 07:23
  • i think its not possible to mark them as delete-able. either you make them editable and therefore also delete-able or you completely lock them – XtremeBaumer Jan 31 '17 at 07:23
  • 2
    can you do that in excel itself? if not apache poi isnt able to do it either – XtremeBaumer Jan 31 '17 at 07:24
  • Well, I am not sure, if it is possible. That's why I opened the thread. ;-) If you tell me it is not possible, I will accept it. ;-) – F4k3d Jan 31 '17 at 07:26
  • i just created a protected worksheet and made delete columns locked and delete rows unlocked. the rows now have read-only cells which means you cant delete them without removing protection first. i think you can make delete columns locked and set the cellstyle of all cells to deleteable – XtremeBaumer Jan 31 '17 at 07:32
  • 1
    i can't find a solution for your problem. maybe you should have a look in the `CTWorksheet` or some other `CT...` stuff. but i think it is not possible – XtremeBaumer Jan 31 '17 at 07:44
  • Thanks a lot for your research efforts. I appreciate this. – F4k3d Jan 31 '17 at 08:15

0 Answers0