---
title: "Worksheet.SetProtected"
url: "https://reference.aspose.com/cells/net/aspose.cells.griddesktop/worksheet/setprotected/"
product: "Aspose.Cells for .NET API Reference"
description: "Worksheet method. Sets cellRange whether it is protected.this is an extended method used only in Grid. This method has nothing to do with the cell.Style.CellLocked property It will not take affect after save to excel file"
---

## Worksheet.SetProtected method

Sets cellRange whether it is protected.this is an extended method used only in Grid. This method has nothing to do with the cell.Style.CellLocked property It will not take affect after save to excel file.

```csharp
public void SetProtected(CellRange range, bool isProtected)
```

| Parameter | Type | Description |
| --- | --- | --- |
| range | CellRange | CellRange object. |
| isProtected | Boolean | Bool value to be set. |

### See Also

* class [CellRange](../../cellrange/)
* class [Worksheet](../)
* namespace [Aspose.Cells.GridDesktop](../../../aspose.cells.griddesktop/)
* assembly [Aspose.Cells.GridDesktop](../../../)


