Exception | Description |
---|---|
System.ArgumentNullException | Occurs when values is null and the rule is currently applied to a Worksheet. |
System.ArgumentException | Occurs when the values array is empty. |
If LimitedValueDataValidationRule.AllowNull is True, null values are allowed in addition to the list of accepted values.
All values will have ToString called on them to covert the accepted values list to a formula.
Note: the formula of accepted values is created by separating each value with a function parameter separator and concatenating them into a single string. So a list of 1, 2, and 3 would have the following formula created: ="1,2,3". However, if the decimal separator of the current culture is a comma (,) then a semicolon (;) will be used to separate the values instead. Because of this, if the ToString of a value returns a string which contains one of these separators, the value will be split into two or more allowed values.
Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
ListDataValidationRule Class
ListDataValidationRule Members
GetValuesFormula(String) Method
GetValuesFormula(String,WorkbookFormat,CellReferenceMode,CultureInfo) Method
SetValuesFormula(String,String) Method
SetValuesFormula(String,String,WorkbookFormat,CellReferenceMode,CultureInfo) Method