Results 1 to 3 of 3

Thread: Open XML SDK Basics with Excel

  1. #1

    Thread Starter
    Karen Payne MVP kareninstructor's Avatar
    Join Date
    Jun 2008
    Location
    Oregon
    Posts
    6,713

    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
    Last edited by kareninstructor; Nov 13th, 2011 at 09:55 PM.

  2. #2

    Thread Starter
    Karen Payne MVP kareninstructor's Avatar
    Join Date
    Jun 2008
    Location
    Oregon
    Posts
    6,713

    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.

    1. In the IDE select menu item View
    2. Select Object Browser
    3. Top left corner labeled Browse select Custom Component Set
    4. Click ellipse to the right of the ComboBox in step 3
    5. A dialog appears
    6. Select the Browse tab
    7. Traverse to the library, default path is C:\Program Files\Open XML SDK\2.0\Lib
    8. Select DocumentFormat.OpenXml.dll
    9. Press the Add button
    10. Press OK


    To add the reference into a project
    1. With your project selected in Solution Explorer
    2. Bring up the Object Browser
    3. Select Custom Components
    4. Select DocumentFormat.OpenXml
    5. Select Add to project button (second circled button in screenshot)
    Attached Images Attached Images  

  3. #3

    Thread Starter
    Karen Payne MVP kareninstructor's Avatar
    Join Date
    Jun 2008
    Location
    Oregon
    Posts
    6,713

    Using Linq to XML to create an excel spreadsheet

    Good article on creating an Excel spreadsheet via OpenXML

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width