//--- Open existing spreadsheet
ExcelApplication xla = new ExcelApplication();
Workbook wb = xla.Open(@"C:\MySpreadsheet.xls");
//--- Get SheetProtection
SheetProtection protection = wb[0].SheetProtection;
//--- Set Properties
protection.AllowFormatCells = true;
protection.AllowSort = false;
|