You need to have the DocumentFormat.OpenXml 2.5.0 dll for ClosedXML to work. If you are OK with adding Open source dll then you can useĬlosedXML.
Using C#, which is the best and easiest way to export all the data from a datatable to an excel to get it downloaded?