Friday, April 8, 2011

Using the Open XML SDK 2.0 Classes to create Excel files

The 2007 Microsoft Office system introduces a new file format that is based on XML called Open XML Formats. Microsoft Office Word 2007, Microsoft Office Excel® 2007, and Microsoft Office PowerPoint® 2007 all use these formats as the default file format.
Open XML formats are useful for developers because they are an open standard and are based on well-known technologies: ZIP and XML. Microsoft provides a library for accessing these files as part of the WinFX technologies in the System.IO.Packaging namespace.


The Open XML Format SDK is built on top of the System.IO.Packaging API and provides strongly typed part classes to manipulate Open XML documents.


The Open Xml SDK 2.0 add-on can be downloaded from the below Microsoft Site for free of cost.










This download requires the following:
        The Microsoft .NET Framework version 3.5 SP1.


There will be two msi files.


1.       Installing OpenXMLSDKv2.0.msi file will register DocumentFormat.OpenXML dll  in your local GAC.
2.       Installing OpenXMLSDKTool.msi will give access to the tool which will create code files
for the given office files.


There is a very good sample too in the following MSDN site.





And also Microsoft provides code samples as msi file for Visual Studio 2010 users.










Note: If the .NET Framework 3.5 SP1 is not already installed on the computer, the setup wizard asks you to install
the .NET Framework 3.5 SP1 first. The default installation path of the SDK is

%systemdrive%\Program Files\Open XML Format SDK\V2.0


Other related useful links for Open XML SDK 2.0



No comments:

Post a Comment