SpreadsheetLight is an open source Open XML spreadsheet library for .NET Framework written in C#, and is released under the MIT License. You can create new Open XML spreadsheets, or work with existing Open XML spreadsheets that are compatible with Microsoft Excel 2007/2010/2013 and LibreOffice Calc.
No Office/Excel Interop needed. You do not need Microsoft Office/Excel to be installed.
Just like magic, it worked immediately, out of the box, no muss, no fuss, and no headache. – Josh Hill (read full thing)
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 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.
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
Simply said: SpreadsheetLight is excellent! I’ve used Excel Automation for a long time and always thought that it’s simply not comfortable enough for me and it’s rather slow and Intellisense is not so much supported. So I searched for something better and found SpreadsheetLight.
I’m really surprised how easy to use and fast SpreadsheetLight is. Today I’ve automated the creation of an excel file that contains all my stocks with a chart and the underlying price table, each of them on a separate named worksheet.
It ended up with just 60 lines of code for nicely formatted price tables and charts which was great, also because I’ve spent only about 2 hours and it was the first time doing it. Another point is that while there is a help included it’s mostly self-explaining. I can really recommend SpreadsheetLight to everyone.
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.
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.
What if you wanted to insert a table? The user simply selects a cell range, selects a table style, and POOF! A table appears.
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 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.
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!
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)
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.
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 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!
I am amazed by the amount of work put in the library: its scope is very
wide, it’s a pleasure to use and it gets the job done. The code seems to be well-organized and I could hack my way through it for small improvements easily. A heartfelt ‘thank you’ to Vincent
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.
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.
Spreadsheetlight fantastic Library
Spreadsheetlight miha life much easier, I’m a newbie in the world of programming. Worked on reporting in excel files in a web application. Simple to use, has many examples, aprendir to work with it in a short time, and has a fantastic performance!!
Vincent Tan congratulations!
Making it easier for developers!
Felipe Cunha Torralvo
Brazil, Sao Paulo
Thanks for such a brilliant piece of software, I’m stress free in my learning curve without much worries about Excel and Open XML.
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?