I've been searching for a solution to my issue for a while so if I have overlooked a solution, please forgive me.
I am trying to set data validation on a column and simply want to pass a comma delimited list for validation. I am attempting to recreate an Excel report that has this functionality embedded.
```
Dim dataV As ClosedXML.Excel.IXLDataValidation = Nothing
dataV = ws.Column(3).AsRange().SetDataValidation()
dataV.List("CD, SD, MW")
dataV.IgnoreBlanks = True
dataV.InCellDropdown = True
dataV.ShowInputMessage = True
dataV.ShowErrorMessage = True
dataV.ErrorStyle = ClosedXML.Excel.XLErrorStyle.Stop
```
The issue is that ClosedXML is generating a formula (with =) in front of the string (=CD, SD, MW). Excel doesn't like this. How can I generate my list without the "="?
Great product BTW...Thanks!
Kelly
Comments: Hope this will help others who are having the same issue and struggling to find examples with the exact syntax for this one. With the aid of the Microsoft Open XML SDK managed to get to the bottom of this and the correct syntax: Syntax as per Kelly's example would be: dataV.List("\"CD, SD, MW\"") i.e. You need additional Quotes around the text string
I am trying to set data validation on a column and simply want to pass a comma delimited list for validation. I am attempting to recreate an Excel report that has this functionality embedded.
```
Dim dataV As ClosedXML.Excel.IXLDataValidation = Nothing
dataV = ws.Column(3).AsRange().SetDataValidation()
dataV.List("CD, SD, MW")
dataV.IgnoreBlanks = True
dataV.InCellDropdown = True
dataV.ShowInputMessage = True
dataV.ShowErrorMessage = True
dataV.ErrorStyle = ClosedXML.Excel.XLErrorStyle.Stop
```
The issue is that ClosedXML is generating a formula (with =) in front of the string (=CD, SD, MW). Excel doesn't like this. How can I generate my list without the "="?
Great product BTW...Thanks!
Kelly
Comments: Hope this will help others who are having the same issue and struggling to find examples with the exact syntax for this one. With the aid of the Microsoft Open XML SDK managed to get to the bottom of this and the correct syntax: Syntax as per Kelly's example would be: dataV.List("\"CD, SD, MW\"") i.e. You need additional Quotes around the text string