Hi,
I have an issue with the protected/locked sheets in xlsx file format. My sheet 
is locked and I want to unlock specific user edit actions say insert columns, 
insert rows etc.

POI 3.7 defines some methods in XSSFSheet.java class like lockInsertColumns(), 
lockInsertRows() and few more.
They should actually allow inserting columns/rows, if sheet is already 
protected/locked.
They actually work reverse of what is expected and pass true to underlying API 
of CTWorksheet.

public void lockInsertColumns() {
        createProtectionFieldIfNotPresent();
        worksheet.getSheetProtection().setInsertColumns(true);
    }

public void lockInsertRows() {
        createProtectionFieldIfNotPresent();
        worksheet.getSheetProtection().setInsertRows(true);
    }

Has anyone faced problem related to specific user edit actions on locked sheet?

My suggestion is, these methods in XSSFSheet.java class should pass false to 
underlying API to work correctly.

I found one discussion on this issue at 
http://apache-poi.1045710.n5.nabble.com/POI-3-6-XSSFSheet-how-can-I-lock-specific-user-edit-actions-on-a-given-sheet-td2312068.html#a2312081


Thanks,
Amol Shinde


Reply via email to