Data Validation
Spread cell types have default data types allowed into the cells, based on the cell type's purpose. For example, number cells do not allow characters other than numbers, separator characters, negative characters, and decimal characters. Characters that are not allowed are not allowed when the user tries to type or paste them in, nor are they allowed when the application tries to set the data.
The following table list each cell type and the type of data it allows in the cell.
Cell Type | Data Allowed | Default Value |
---|---|---|
Button | 0 or 1; Empty string to set to "not set" | 0 |
Check box | 0, 1, or 2 (if three-state); Empty string to set to "not set" | 0 |
Combo box | Text string of selected item or index number of selected item; if editable, any characters | Empty string |
Currency | Numeric data, currency symbol, separator character, negative character, and decimal character | Empty string; substitutes 0 when invalid data is set by the application. Leaves current valid value if user tries to type invalid data. |
Date | Numeric data, day values, and separator characters | Empty string |
Edit | Any characters unless restricted by the TypeEditCharSet property | Empty string |
Number | Numeric data, separator character, negative character, and decimal character | Empty string; substitutes 0 when invalid data is set by the application. Leaves current valid value if user tries to type invalid data. |
Owner-Drawn | Not applicable | |
Percent | Numeric data, separator character, negative character, and decimal character | Empty string; substitutes 0 when invalid data is set by the application. Leaves current valid value if user tries to type invalid data. |
PIC | Depends on defined mask | Empty string |
Picture | Bitmap or icon graphic | |
Scientific | Numeric data, negative character, and decimal character | Empty string; substitutes 0 when invalid data is set by the application. Leaves current valid value if user tries to type invalid data. |
Static Text | Any characters | Empty string |
Time | Numeric data, separator characters, and AM/PM designator | Empty string |
If you try to type or provide other types of data in the cell, the cell will not allow the data and will either display its default value (listed in the table) or leave the current value in the cell until a valid value is provided.
For more information about setting up the formatting for cells and about providing data for different cell types, see Setting the Cell Type and the Text and Value properties in the ActiveX Reference or the SSSetData and SSSetValue functions in the DLL Reference.