Yes, protection only works on the entire sheet, not cells. What you do is set the cells you want to protect as "locked" and all other cells as "unlocked", then you enable protection on the sheet to turn the protection of locked cells on and off.
You can see this in Excel by selecting a range of cells, then right-clicking on that range and pick "Format Cells". Click on the Protection tab in the dialog that shows up to get/set the Locked state for the selected cells.
When you get all the cells you want to protect setup as "locked", you then enable Protection on the sheet to enforce it.
If you're going to dig into this stuff, it helps to know how Excel works. They cover this kind of stuff in the documentation for Excel.
--- EDIT ---
By default, all cells are formatted "Locked = true" so you don't have to do anything to them unless you want to leave cells unprotected.
To actually turn on protection for the sheet, you have to create a SheetProtection object and add it to the parent WorksheetPart of the sheet.
ProtectSheet(worksheetPart, "P@ssword");
...
static void ProtectSheet(WorksheetPart worksheetPart, string password)
{
byte[] passwordBytes = Encoding.Unicode.GetBytes(password);
byte[] salt = new byte[16];
RandomNumberGenerator.Fill(salt);
uint spinCount = 10000;
SheetProtection sheetProtection = new SheetProtection()
{
Sheet = true,
Objects = true,
Scenarios = true,
SelectLockedCells = true,
AlgorithmName = "SHA-512",
HashValue = Convert.ToBase64String(GetPasswordHash(passwordBytes, salt, spinCount)),
SaltValue = Convert.ToBase64String(salt),
SpinCount = spinCount
};
worksheetPart.Worksheet.Append(sheetProtection);
}
static byte[] GetPasswordHash(byte[] password, byte[] salt, uint spinCount)
{
using (SHA512 sha512 = SHA512.Create())
{
byte[] buffer = new byte[salt.Length + password.Length];
Array.Copy(salt, buffer, salt.Length);
Array.Copy(password, 0, buffer, salt.Length, password.Length);
byte[] hash = sha512.ComputeHash(buffer);
buffer = new byte[hash.Length + 4];
for (int i = 0; i < spinCount; i++)
{
Array.Copy(hash, buffer, hash.Length);
Array.Copy(BitConverter.GetBytes(i), 0, buffer, hash.Length, 4);
hash = sha512.ComputeHash(buffer);
}
return hash;
}
}