[]
Gets or sets the data validation error message.
Use this property to get or configure the message associated with the validation rule for the range.
string ErrorMessage { get; set; }
Property ErrorMessage As String
IValidation validation = worksheet.Range["A1"].Validation;
validation.Add(ValidationType.Whole, ValidationAlertStyle.Stop, ValidationOperator.Between, 1, 10);
validation.ErrorMessage = "Input a value between 1 and 10.";
string errorMessage = validation.ErrorMessage;