'Declaration Public Overloads Sub SetUpperConstraint( _ ByVal value As System.TimeSpan _ )
public void SetUpperConstraint( System.TimeSpan value )
Exception | Description |
---|---|
System.ArgumentException | Occurs when the specified value is less than the lower constraint value. If the lower constraint formula does not equal a constant, this verification is not performed. |
The way in which the cell value is compared to the upper constraint value is determined by the ValidationOperator as well as the ValueConstraintDataValidationRule.ValidationCriteria.
Depending on the ValidationCriteria of the rule, either the cell value itself or the length of the cell value's text equivalent is compared to the upper constraint value.
When the ValidationOperator is Between, the value must be greater than or equal to the lower constraint and less than or equal to the upper constraint. When the ValidationOperator is NotBetween, the value must be less than the lower constraint or greater than the upper constraint.
This overload is preferred when the ValidationCriteria is Time. When the ValidationCriteria is WholeNumber, Decimal, or TextLength, the SetUpperConstraint(Double) overload is preferred, and when the ValidationCriteria is Date, the SetUpperConstraint(DateTime) overload is preferred.
Target Platforms: Windows 8.1, Windows 8.1, Windows 8, Windows 7, 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
TwoConstraintDataValidationRule Class
TwoConstraintDataValidationRule Members
Overload List
SetLowerConstraint(TimeSpan) Method
SetUpperConstraint(Double) Method
SetUpperConstraint(DateTime) Method
SetUpperConstraintFormula(String,String) Method
SetUpperConstraintFormula(String,String,WorkbookFormat,CellReferenceMode,CultureInfo) Method
ValidationOperator Property
ValidationCriteria Property
View on GitHub