Код: Выделить всё
SheetProtection sheetProtection = new SheetProtection
{
SelectLockedCells = true, // Allow selection of locked cells
SelectUnlockedCells = true
Sheet = true, // Enable sheet protection
Objects = true, // Protect objects (like charts)
Scenarios = true, // Protect scenarios
FormatCells = false, // Prevent formatting of locked cells
FormatColumns = false, // Prevent formatting columns
FormatRows = false, // Prevent formatting rows
};
sheetPart.Worksheet.InsertAfter(sheetProtection, sheetData);
Код: Выделить всё
Подробнее здесь: https://stackoverflow.com/questions/793 ... etprotecti
Мобильная версия