Open source developer-friendly spreadsheet library compatible with Microsoft Excel 2007/2010/2013

SpreadsheetLight is an open source spreadsheet library/component for .NET Framework written in C#. It is freely available and uses the MIT License. It generates Open XML spreadsheets that are compatible with Microsoft Excel 2007/2010/2013 (and even LibreOffice Calc).

Read in an existing Excel spreadsheet, modify an existing spreadsheet, or just create a new spreadsheet from scratch. You can do all that with just a few lines of code.

Download it now. Check out the tons of code examples. See benchmarks of how SpreadsheetLight perform in speed and memory use.

Light on learning curve. Light on memory use. Light on its feet.

Do you dread writing code to automate the creation of Microsoft Excel spreadsheets? Do you hate your user for asking you to make one simple styling change? (“It’s just changing the cell background color!”, she says). Does your server choke when you’re writing millions of cells into a worksheet?

Have you ever wished you could write code that’s as easy as using Microsoft Excel? I mean, why should the user have all the fun?

We evaluated several open source and paid Excel libraries and found SpreadsheetLight to be the best based on features, ease of use, support, and performance. The SpreadsheetLight code is very well architected and easy to understand. We put SpreadsheetLight through a battery of functional and performance tests and were very pleased. We also found Vincent Tan to be very responsive to our question. We are using SpreadsheetLight both internally as well as in our commercial products. Thanks Vincent, impressive job.

Clark French
President
Computer Intelligence Associates, Inc.

I found it easy to use and am very happy with it. I think it doesn’t show the most advanced object-architecture, but that is something I really appreciate. The more plain and simple the better I like it. Others might like an approach that makes working with it more like working with a DataTable. But I understand that for more complex / mixed documents that wouldn’t work.

Gabriël van der Kruijk MScBA
Algemeen Directeur

SpreadsheetLight is a must have for everyone, who has to deal with exporting data to XLSX. Easy to use and very fast. Also Vincent was very responsive to my requests about the autofitting problem.

Christian Tinauer
Software Engineering
www.boomsoftware.com
Austria

SpreadsheetLight is a useful tool for generating XLSX “on the fly” directly on the web server. Using SpreadsheetLight is as the same as forming a table directly in MS Excel. We learned working with SpreadsheetLight in a short time and it is now an integral part of our web projects. I highly recommend it and thank to the author.

Martin Cermak
CFit s.r.o.
Czech Republic

What if you wanted to insert a table? The user simply selects a cell range, selects a table style, and POOF! A table appears.

Excel table

Here’s how you do it with SpreadsheetLight:

SLTable tbl = sl.CreateTable("B2", "G6");
tbl.SetTableStyle(SLTableStyleTypeValues.Medium4);
sl.InsertTable(tbl);
// POOF! Table appears.

After spending countless hours trying to get Open XML to do exactly what I want, and wrangling commercial solutions, I stumbled across SpreadsheetLight. An hour later, I’ve solved my problem and can get back to working on actual solutions for my customers instead of conforming to arcane XML requirements.

The fact that this is open source and MIT license is icing on the cake. Thank you thank you thank you, you’ve made this developer’s life a lot happier.

Marcus Denny

After wasting too much time with the Microsoft-provided libraries for reading and writing spreadsheets (OpenXML SDK, OleDbAdapter, Excel COM API), it was time to get over my 3rd-party aversion and find a library that worked. I was initially drawn to SpreadsheetLight by the quality of the website and online documentation. After downloading, I was equally impressed with the quality of the library. It’s delightfully lightweight because it’s simply an abstraction added on top of the OpenXML SDK. No more worrying about XML Elements or looking up strings—just read or write a cell and be on your merry way. Highly recommended.

Alex Bestul

I have worked with another library to create older XLS spreadsheets but I found your library to be far superior in ease of use and elegance of design. I found that whenever I had a need, I was able to find a corresponding class in SpreadsheetLight. I was particularly impressed with the ease of integrating my datasets and creating the formatted result my customer required. I would and do highly recommend SpreadsheetLight to anyone needing to integrate spreadsheets into their application.

Vincent was very responsive to my early questions and set me on the correct path. The OpenXML SDK is daunting and I doubt I could have accomplished my objectives without SpreadsheetLight. Thank you for the excellent work!

John Lee
Marymonte Systems

I was quite shocked by how much of a good job you’ve done on the whole package. I say shocked, because we’ve written our own in-house Excel document editing library in C# so I know the pain of constantly decompiling, recompiling, tweaking values, watching it break, fixing it, etc. It’s only fun for so long (2 minutes) :)

Rob Hutchinson

How about adding some conditional formatting? The user simply selects a cell range, decides on a data bar (“I want light blue”), and POOF! Conditional formatting done.

Data bar

Here’s how you do it with SpreadsheetLight:

SLConditionalFormatting cf = new SLConditionalFormatting("C3", "G6");
cf.SetDataBar(SLConditionalFormatDataBarValues.LightBlue);
sl.AddConditionalFormatting(cf);
// POOF! Conditional formatting done.

I have to make a proof of concept application with reporting and eventually export the reports into Excel (and the charts). Working with OpenXML was fine for setting cell values but when it came to add charts and set the series of data for them it got extremely complicated and there is not much documentation on the internet about manipulating charts with OpenXML. Lucky for me I found your library which is awesome! I managed to implement my method for charting in like 10 minutes.

Calin Bunea

I was very pleased with the accessibility and power of your SpreadsheetLight library. I was also amazed at the timely and professional responses received regarding my questions. I would recommend this library for anyone who needs to create simple yet customizable charting solutions. Keep up the good work!

Aaron Ertler

First time to use SpreadsheetLight and most likely will not change it for a long time. I worked on generating excel file for a report in a web application. I tried Interop.Excel which has the worst performance ever(18 minutes to stream excel file ). Then tried openxml which has a great performance but making a simple chart is really a challenge(openxml doesn’t have friendly tutorials and for charts they give a non-realistic example “chart depending on array[]“. After studying the charts thoroughly, to create a simple column chart you will need between 15-30 line of code ). Then, I saw SpreadsheetLight and used it: Performance is great, charts 3-4 lines, indexing to set values using both cell reference and row-column index. Thanks SpreadsheetLight Team.

Faisal S. Shoail

How about inserting an area chart? The user simply selects a cell range, decides on the area chart, and POOF! Chart done.

Area chart

Here’s how you do it with SpreadsheetLight:

SLChart chart = sl.CreateChart("B2", "G6");
chart.SetChartType(SLAreaChartType.StackedArea3D);
chart.SetChartPosition(7, 1, 22, 8.5);
sl.InsertChart(chart);
// POOF! Chart done.

You get to do even complex tasks in an intuitive manner. If you know how to use Microsoft Excel, then you know how to do it with SpreadsheetLight.

Thanks for such a brilliant piece of software, I’m stress free in my learning curve without much worries about Excel and Open XML.

Anele Mbanga

Worried about memory resources?

SpreadsheetLight runs on very little memory, so your server can run more programs and tasks (or take a break and drink pina colada. I suppose your server can run idle while you’re doing that).

Generating 3 worksheets, each with 18 million cells (yes you read that right) take slightly over 3 GB of RAM at any one time. See here for more details.

Worried about speed?

SpreadsheetLight runs like the wind, and can generate 54 million cells in slightly over 6 minutes. See here for more details.

SpreadsheetLight is dedicated to making your life as a spreadsheet-creating developer as easy as the Microsoft Excel user. Possibly even easier. Download it now! It’s free and is open source.

Not ready yet? How about checking all the sample source code that shows you how to save hours of frustration?