I did this with the following code:
//ExcelWorksheet ws var validation = ws.DataValidations.AddListValidation(cell.Address); validation.ShowErrorMessage = true; validation.ErrorStyle = ExcelDataValidationWarningStyle.stop; validation.ErrorTitle = "Error"; validation.Error = "Error Text"; // sheet with a name : DropDownLists // from DropDownLists sheet, get values from cells: !$A$1:$A$10 var formula = "=DropDownLists!$A$1:$A$10" //Applying Formula to the range validation.Formula.ExcelFormula = formula;
source share