// Create a new workbook Workbook workbook = new Workbook(); IWorksheet worksheet = workbook.getWorksheets().get(0); //protect worksheet, allow insert column. worksheet.setProtection(true); worksheet.getProtectionSettings().setAllowInsertingColumns(true); //Unprotect worksheet. worksheet.setProtection(false); // Save to an excel file workbook.save("UnprotectWorksheet.xlsx");