Open XML SDK Basics with Excel
The VS2008 solution contains various projects, which begin to scratch the surface of working with OpenXml SDK, which is free from Microsoft, which gives you the ability to work with Excel 2007/2010 files without Excel installed (along with other Office products such as Word and PowerPoint).
What to expect: working with the SDK will not be easy to work with if you are not willing to put time and effort into understanding the SDK. I have focused on simple reading of data from Excel files along with showing some things which you will not find on the web (I did not and had to create my own solutions) while others things demonstrated use code and a library I found on the web.
Level of expertise: If you are a beginner developer most likely, you will become frustrated quickly. You will need a good understanding of both Excel file structure and a good understanding of coding in .NET which includes LINQ and Lambda.
Make sure to read the readme file in the solution, which contains points on the projects and a good deal of links for working with the Open XML SDK.
Resource
Get started with OpenXML
Download OpenXML SDK (and tool)
Download LINQ Table extensions
Open XML snippets
Open-XML content by keyword
Solution was not uploaded as it is larger than allowed to upload here
http://kevininstructor.home.comcast....Open_XML_1.zip
1 Attachment(s)
Re: Open XML SDK Basics with Excel
The easiest method to add the OpenXML library to your projects is by adding the library to the custom Component Set in the Object Browser.
- In the IDE select menu item View
- Select Object Browser
- Top left corner labeled Browse select Custom Component Set
- Click ellipse to the right of the ComboBox in step 3
- A dialog appears
- Select the Browse tab
- Traverse to the library, default path is C:\Program Files\Open XML SDK\2.0\Lib
- Select DocumentFormat.OpenXml.dll
- Press the Add button
- Press OK
To add the reference into a project
- With your project selected in Solution Explorer
- Bring up the Object Browser
- Select Custom Components
- Select DocumentFormat.OpenXml
- Select Add to project button (second circled button in screenshot)
Using Linq to XML to create an excel spreadsheet
Good article on creating an Excel spreadsheet via OpenXML