This article explains why data validation list throws argument out of range exception in XlsIO using C#/VB.NET.
What is data validation list?
Data validation means allowing values to the cell in the worksheet based on given conditions. The data validation list contains the values that can be given for a cell in a drop-down box. The values for the list can be given by selecting a range in the worksheet which contains values or it can be given directly in IDatavalidation.ListofValues by separating them using (,) operator.
When the values are given directly, MS-Excel only allow values up to 255 characters length including the separator. XlsIO follows the same behavior as MS-Excel which results in throwing “Argument out of range exception” when the values character length more than 255. So, we need to ensure the characters length in the IDatavalidation.ListofValues is below 255.
The following C#/VB.NET complete code snippet shows the scenario where data validation throws argument out of range exception in XlsIO.
|Article ID:||Published Date:||Last Revised Date:||Platform:||Control:|