Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Post History

66%
+2 −0
Q&A Which .NET project can programmatically validate a cell's value out of the box based on Excel data validation constraints?

Are any of the popular Excel .NET projects have a functionality similar to Apache POI's DataValidationEvaluator class?

1 answer  ·  posted 1y ago by toraritte‭  ·  edited 1y ago by toraritte‭

Question c# f# excel Open-XML-SDK
#3: Post edited by user avatar toraritte‭ · 2023-11-23T03:27:52Z (about 1 year ago)
  • What I would like to do:
  • 1. Set a cell value.
  • 2. Check with a program if cell values conform to data validation rules.
  • I could extract all the information needed to create a validation function, but I don't want to re-invent the wheel.
  • What I have in mind is along the lines of how [NPOI](https://github.com/nissl-lab/npoi) allows recalculating all formulas to reflect changes in a workbook:
  • ```fsharp
  • let recalculateFormulas (workbook: XSSFWorkbook) =
  • let creationHelper = workbook.GetCreationHelper()
  • let formulaEvaluator = creationHelper.CreateFormulaEvaluator()
  • formulaEvaluator.EvaluateAll()
  • ```
  • [1]: https://learn.microsoft.com/en-us/office/open-xml/open-xml-sdk
  • Are any of the popular Excel .NET projects have a functionality similar to Apache POI's [`DataValidationEvaluator`](https://poi.apache.org/apidocs/dev/org/apache/poi/ss/formula/DataValidationEvaluator.html) class?
#2: Post edited by user avatar toraritte‭ · 2023-11-22T20:08:23Z (about 1 year ago)
  • How to programmatically validate a cell's value based on Excel data validation constraints?
  • Which .NET project can programmatically validate a cell's value out of the box based on Excel data validation constraints?
  • What I would like to do:
  • 1. Set a cell value.
  • 2. Check with a program if the cell value conforms to the data validation rules set for that cell.
  • I could extract all the information needed to create a validation function, but I don't want to re-invent the wheel.
  • ---
  • This question may be perceived as a duplicate of [Is there a way to programmatically evaluate Excel data validations using npoi in .NET?](https://stackoverflow.com/questions/74204029/is-there-a-way-to-programmatically-evaluate-excel-data-validations-using-npoi-in), but I tried to cast a wider net while also attempting to provide an answer.
  • [1]: https://learn.microsoft.com/en-us/office/open-xml/open-xml-sdk
  • What I would like to do:
  • 1. Set a cell value.
  • 2. Check with a program if cell values conform to data validation rules.
  • I could extract all the information needed to create a validation function, but I don't want to re-invent the wheel.
  • What I have in mind is along the lines of how [NPOI](https://github.com/nissl-lab/npoi) allows recalculating all formulas to reflect changes in a workbook:
  • ```fsharp
  • let recalculateFormulas (workbook: XSSFWorkbook) =
  • let creationHelper = workbook.GetCreationHelper()
  • let formulaEvaluator = creationHelper.CreateFormulaEvaluator()
  • formulaEvaluator.EvaluateAll()
  • ```
  • [1]: https://learn.microsoft.com/en-us/office/open-xml/open-xml-sdk
#1: Initial revision by user avatar toraritte‭ · 2023-11-20T20:09:50Z (about 1 year ago)
How to programmatically validate a cell's value based on Excel data validation constraints?
What I would like to do:

1. Set a cell value.
2. Check with a program if the cell value conforms to the data validation rules set for that cell.

I could extract all the information needed to create a validation function, but I don't want to re-invent the wheel. 

---

This question may be perceived as a duplicate of [Is there a way to programmatically evaluate Excel data validations using npoi in .NET?](https://stackoverflow.com/questions/74204029/is-there-a-way-to-programmatically-evaluate-excel-data-validations-using-npoi-in), but I tried to cast a wider net while also attempting to provide an answer.


  [1]: https://learn.microsoft.com/en-us/office/open-xml/open-xml-sdk