using LINQ on Excel 2007 for VB.NET and C Sharp
If you would like to get into reading Excel 2007+ files using an alternate method other than Office automation or OleDb or third party library.
Using LINQ to Query Tables in Excel 2007 (requires OpenXML from Microsoft)
Code for C Sharp and VB.NET
Caveat for running either project.
- Download OpenXml first
- Open project references
- Remove reference to OpenXml (should be reported as missing)
- Now add new reference via the browse button under project properties, reference tab
- In the main code search for LinqSample.xlsx and adjust the path as needed before running.
- Build/Run