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