| Visual Basic (Declaration) | |
|---|---|
Public Overloads Sub Add( _ ByVal rule As ListDataValidationRule, _ ByVal cell As WorksheetCell _ ) | |
| C# | |
|---|---|
public void Add( ListDataValidationRule rule, WorksheetCell cell ) | |
Parameters
- rule
- The data validation rule to apply to the cell.
- cell
- The cell to which the data validation rule should be applied.
| Exception | Description |
|---|---|
| Occurs when is null. | |
| Occurs when is null. | |
| Occurs when the is from a worksheet other than this collection. | |
| Occurs when the already applied to another worksheet. | |
| Occurs when the is invalid based on its rule type's requirements. | |
| Occurs when the already has a data validation rule applied to it. |