XlsValidationWrapper module
- class XlsValidationWrapper.XlsValidationWrapper
Bases:
CommonWrapper,IDataValidation,IExcelApplicationA wrapper class for Excel data validation functionality.
This class extends CommonWrapper and implements IDataValidation and IExcelApplication interfaces to provide a wrapper around Excel data validation functionality. It allows for creating and managing data validation rules that restrict the type of data or values users can enter into a cell or range in Excel worksheets.
- property AlertStyle: AlertStyleType
Gets or sets the style of the error alert.
Determines the icon and buttons displayed in the error message box when invalid data is entered.
- Returns:
The style of the error alert.
- Return type:
AlertStyleType
- property AllowType: CellDataType
Gets or sets the data type allowed in the cell or range.
This property determines what type of data is valid for the cells with validation.
- Returns:
The data type allowed for validation.
- Return type:
CellDataType
- property CompareOperator: ValidationComparisonOperator
Gets or sets the comparison operator for the data validation.
This property determines how the cell’s value is compared against the validation criteria.
- Returns:
The comparison operator for validation.
- Return type:
ValidationComparisonOperator
- property DataRange: IXLSRange
Gets or sets the cell range to which the data validation applies.
This property specifies the range of cells that will have this validation rule applied.
- Returns:
The cell range with this validation rule.
- Return type:
IXLSRange
- property DateTime1: DateTime
Gets or sets the first date/time value for the data validation.
Used when validating date or time values, typically as the minimum value.
- Returns:
The first date/time value for validation.
- Return type:
DateTime
- property DateTime2: DateTime
Gets or sets the second date/time value for the data validation.
Used when validating date or time values with a range, typically as the maximum value.
- Returns:
The second date/time value for validation.
- Return type:
DateTime
- property ErrorMessage: str
Message of the error box.
- property ErrorTitle: str
Title of the error box.
- property Formula1: str
Gets or sets the first formula or value for the data validation.
For most validation types, this property sets the minimum value or the only value used for validation.
- Returns:
The first formula or value for validation.
- Return type:
str
- property Formula2: str
Gets or sets the second formula or value for the data validation.
For validation types that require a range (like between or not between), this property sets the maximum value.
- Returns:
The second formula or value for validation.
- Return type:
str
- property IgnoreBlank: bool
Gets whether blank values are allowed in the validated range.
When True, empty cells are considered valid regardless of the validation criteria.
- Returns:
True if blank values are allowed; otherwise, False.
- Return type:
bool
- property InputMessage: str
Message of the input box.
- property InputTitle: str
Title of the input box.
- property IsInputPositionFixed: bool
Gets or sets whether the input message box position is fixed.
When True, the input message box appears at the position specified by PromptBoxHPosition and PromptBoxVPosition. When False, the position is determined automatically.
- Returns:
True if the input message box position is fixed; otherwise, False.
- Return type:
bool
- property IsInputVisible: bool
Gets or sets whether the input message box is visible.
Controls the visibility of the input message box independently of ShowInput.
- Returns:
True if the input message box is visible; otherwise, False.
- Return type:
bool
- property IsListInFormula: bool
Gets whether the validation list is in a formula.
When True, the Formula1 property contains a formula that evaluates to a list. When False, Formula1 contains a comma-separated list of values.
- Returns:
True if the validation list is in a formula; otherwise, False.
- Return type:
bool
- property IsSuppressDropDownArrow: bool
Gets whether to suppress the dropdown arrow for list validation.
When True, the dropdown arrow for list-type validation is not displayed.
- Returns:
True if the dropdown arrow is suppressed; otherwise, False.
- Return type:
bool
- property Parent: SpireObject
Gets the parent object of this validation wrapper.
- Returns:
The parent object of this validation wrapper.
- Return type:
SpireObject
- property PromptBoxHPosition: int
Gets or sets the horizontal position of the input message box.
Specifies the horizontal offset in pixels for the input message box.
- Returns:
The horizontal position in pixels.
- Return type:
int
- property PromptBoxVPosition: int
Gets or sets the vertical position of the input message box.
Specifies the vertical offset in pixels for the input message box.
- Returns:
The vertical position in pixels.
- Return type:
int
- property ShowError: bool
Gets or sets whether to display an error message when invalid data is entered.
When True, the error message (specified by ErrorTitle and ErrorMessage) is displayed when the user enters invalid data in a cell with this validation.
- Returns:
True if the error message is displayed; otherwise, False.
- Return type:
bool
- property ShowInput: bool
Gets or sets whether to display the input message when a cell is selected.
When True, the input message (specified by InputTitle and InputMessage) is displayed when the user selects a cell with this validation.
- Returns:
True if the input message is displayed; otherwise, False.
- Return type:
bool
- property Values: List[str]
Gets or sets the list of valid values for list-type validation.
For list-type validation, this property contains the list of values that are considered valid.
- Returns:
The list of valid values.
- Return type:
List[str]
