I have never tried this so do not know if it will work but here goes anyway.
If you Open a workbook using Excel and then try to set the format of a cell, one of the things you notice is that the 'Locked' checkbox on the Protection tab is selected automatically. My hypothesis is that if it were possible to locate the setting within Excel that determines this to be the default and reverse it so that cells are, by default, not locked and then save the file to use as a template, then subsequent files that were created using POI with this template as their basis would have only cells locked by the cell style applied to them. I do not know if this is truly the case nor where the default is set within Excel - though I dod suspect it may revolve around the default cell style - but I believe it could be worth looking for. The reason I have focused on Excel and not POI is that empty cells that exist outside of the POI created cells when the worksheet is viewed in Excel are the purvies of the latter application itself and POI cannot control them. I think the focus has to shift to Excel as it 'creates' and control those empty rows and cells. Will have a dig around for the setting today - between gardening duties - and post if I find anything further. Yours Mark B Daniel Meier-3 wrote: > > Hi there, > > is there a way to unlock all cells in a sheet. By default every single > cell > is locked. > The problem is, after enabling the sheet protection, you can not delete a > row (even if it is allowed in the worksheet protection settings). > > Because cell styles are set only after createCell() was called, i would > have > to create a sheet and all cells in it with a "unlockedCellStyle". But this > leads to several other problems (ex. 16'000 cols an 100'000 rows). > > I didnt found a way to set a default cell style. Even DefaultColumnStyle > works only for new created cells. > > Does anybody now a solution for this. > thank you > > -- View this message in context: http://old.nabble.com/Unlock-all-cells-in-a-sheet-tp28192938p28200313.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]
