// 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); // Save to an excel file workbook.save("ProtectWorksheet.xlsx");