Class ExcelProtectedRangeCollection
A collection of protected ranges in the worksheet. ExcelProtection ExcelSheetProtection ExcelEncryption
Inherited Members
Namespace: OfficeOpenXml
Assembly: EPPlus.dll
Syntax
public class ExcelProtectedRangeCollection : XmlHelper, IEnumerable<ExcelProtectedRange>, IEnumerable
Properties
Count
Numner of items in the collection
Declaration
public int Count { get; }
Property Value
| Type | Description |
|---|---|
| int |
this[int]
Indexer for the collection
Declaration
public ExcelProtectedRange this[int index] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | The index to return |
Property Value
| Type | Description |
|---|---|
| ExcelProtectedRange |
Methods
Add(string, ExcelAddress)
Adds a new protected range
Declaration
public ExcelProtectedRange Add(string name, ExcelAddress address)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name of the protected range |
| ExcelAddress | address | The address within the worksheet |
Returns
| Type | Description |
|---|---|
| ExcelProtectedRange |
Clear()
Clears all protected ranges
Declaration
public void Clear()
Contains(ExcelProtectedRange)
Checks if the collection contains a specific item.
Declaration
public bool Contains(ExcelProtectedRange item)
Parameters
| Type | Name | Description |
|---|---|---|
| ExcelProtectedRange | item |
Returns
| Type | Description |
|---|---|
| bool |
CopyTo(ExcelProtectedRange[], int)
Copies the entire collection to a compatible one-dimensional array, starting at the specified index of the target array.
Declaration
public void CopyTo(ExcelProtectedRange[] array, int arrayIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| ExcelProtectedRange[] | array | The array |
| int | arrayIndex | The index |
IndexOf(ExcelProtectedRange)
Get the index in the collection of the supplied item
Declaration
public int IndexOf(ExcelProtectedRange item)
Parameters
| Type | Name | Description |
|---|---|---|
| ExcelProtectedRange | item | The item |
Returns
| Type | Description |
|---|---|
| int |
Remove(ExcelProtectedRange)
Remove the specified item from the collection
Declaration
public bool Remove(ExcelProtectedRange item)
Parameters
| Type | Name | Description |
|---|---|---|
| ExcelProtectedRange | item | The item |
Returns
| Type | Description |
|---|---|
| bool |
RemoveAt(int)
Remove the item at the specified indexx
Declaration
public void RemoveAt(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index |