//create a new workbook var workbook = new GrapeCity.Documents.Excel.Workbook(); IWorksheet worksheet = workbook.Worksheets[0]; //protect worksheet, allow insert column. worksheet.Protection = true; worksheet.ProtectionSettings.AllowInsertingColumns = true; //Unprotect worksheet. worksheet.Protection = false;
' Create a new Workbook Dim workbook As New Workbook Dim worksheet As IWorksheet = workbook.Worksheets(0) 'protect worksheet, allow insert column. worksheet.Protection = True worksheet.ProtectionSettings.AllowInsertingColumns = True 'Unprotect worksheet. worksheet.Protection = False ' save to an excel file workbook.Save("UnprotectWorksheet.xlsx")