Create or edit Excel documents
Create new Excel documents from scratch, or open existing Excel documents and edit them.
The ExpertXLS Excel Library for .NET can be linked into any type of .NET project, ASP.NET web sites, Windows Forms or WPF applications, to create new Excel documents from scratch or to edit existing ones, in the Excel 97-2003 (.xls) and Excel 2007 or above (.xlsx) formats.
The library is a .NET managed assembly and does not depend on Microsoft Office Excel. There is nothing to install: reference the strong named assembly from your project. ExpertXLS is also part of the ExpertComponents Toolkit Total.
Documentation · C# online demo · VB.NET online demo · Blazor online demo · NuGet · Download .zip (v10.0.1)
Grouped by what they act on: the workbook and its data, the worksheet content, the formatting and page setup, and protection and deployment.
New or existing Excel documents, in files or streams, with data from CSV files and .NET DataTables.
Create new Excel documents from scratch, or open existing Excel documents and edit them.
Support for the Excel 97-2003 (.xls) and the Excel 2007 or above (.xlsx) formats.
Load a workbook from a stream or from a file, and save a workbook to a stream or to a file.
Load data from CSV files and save data to CSV format.
Load data from a .NET DataTable, or save data to a DataTable object.
Formulas, charts, images, hyperlinks, comments, named ranges and data validation.
Add formulas and array formulas to a worksheet.
Add chart shapes to a worksheet, or chart worksheets to a workbook.
Add images to a worksheet.
Add hyperlinks and comments to a worksheet.
Add named ranges at worksheet or at workbook level.
Restrict what can be entered in the cells of a worksheet.
Cell value and formula rules, two and three color scales, data bars and icon sets, in .xls and .xlsx.
Add filter buttons to a range and filter a column by values or conditions.
Create tables from ranges, with a built-in style, banded rows and a totals row (.xlsx).
Find and replace text in a range, a worksheet or the whole workbook, and sort a range by one or more columns.
Line, column and win/loss sparklines in the cells of .xlsx documents.
Styles, gradients and textures, page setup and workbook properties.
Add global styles to a workbook and apply them to cells and ranges.
Advanced support for the Excel 2007 and above gradients and textures.
Worksheet headers and footers, paper size, margins and orientation.
Set the workbook author, subject, comments and the other document properties.
Workbook and worksheet protection, and a single assembly with no installation.
Protect the workbook windows and structure.
Protect the data of a worksheet.
Read and write password protection for .xls workbooks.
Easy integration: no installation or setup is necessary. Reference the assembly from your project.
Runs in ASP.NET applications with the trust level restricted to Medium Trust, for example on shared hosting.
Runs on 32-bit and 64-bit Windows servers.
Create a workbook with values, a formula and a chart, or open an existing one and edit it. The download has C# and VB.NET samples for ASP.NET and Windows Forms.
using ExpertXls.ExcelLib; // A new workbook in the Excel 2007 or above format (.xlsx) var workbook = new ExcelWorkbook(ExcelWorkbookFormat.Xlsx_2007); workbook.LicenseKey = "your license key"; ExcelWorksheet worksheet = workbook.Worksheets[0]; worksheet.Name = "Revenue"; worksheet["A1"].Text = "Region"; worksheet["B1"].Text = "Q1"; worksheet["C1"].Text = "Q2"; worksheet["A1:C1"].Style.Font.Bold = true; worksheet["A2"].Text = "North"; worksheet["B2"].Value = 48200; worksheet["C2"].Value = 52400; worksheet["A3"].Text = "South"; worksheet["B3"].Value = 31500; worksheet["C3"].Value = 36800; // A formula and a number format worksheet["A4"].Text = "Total"; worksheet["B4"].Formula = "=SUM(B2:B3)"; worksheet["C4"].Formula = "=SUM(C2:C3)"; worksheet["B2:C4"].Style.Number.NumberFormatString = "#,##0"; // A column chart from A1:C3, series by rows, // placed from column 2, row 7 to column 8, row 22 ExcelChart chart = worksheet.Charts.AddChart(ExcelChartType.ColumnClustered, worksheet["A1:C3"], true, 2, 7, 8, 22); chart.Title.Text = "Revenue per quarter"; workbook.Save(@"C:\Docs\revenue.xlsx"); workbook.Close();
Imports ExpertXls.ExcelLib ' A new workbook in the Excel 2007 or above format (.xlsx) Dim workbook As New ExcelWorkbook(ExcelWorkbookFormat.Xlsx_2007) workbook.LicenseKey = "your license key" Dim worksheet As ExcelWorksheet = workbook.Worksheets(0) worksheet.Name = "Revenue" worksheet("A1").Text = "Region" worksheet("B1").Text = "Q1" worksheet("C1").Text = "Q2" worksheet("A1:C1").Style.Font.Bold = True worksheet("A2").Text = "North" worksheet("B2").Value = 48200 worksheet("C2").Value = 52400 worksheet("A3").Text = "South" worksheet("B3").Value = 31500 worksheet("C3").Value = 36800 ' A formula and a number format worksheet("A4").Text = "Total" worksheet("B4").Formula = "=SUM(B2:B3)" worksheet("C4").Formula = "=SUM(C2:C3)" worksheet("B2:C4").Style.Number.NumberFormatString = "#,##0" ' A column chart from A1:C3, series by rows, ' placed from column 2, row 7 to column 8, row 22 Dim chart As ExcelChart = worksheet.Charts.AddChart(ExcelChartType.ColumnClustered, worksheet("A1:C3"), True, 2, 7, 8, 22) chart.Title.Text = "Revenue per quarter" workbook.Save("C:\Docs\revenue.xlsx") workbook.Close()
Install with dotnet add package ExpertXls.ExcelLibrary, or reference expertxls.dll from the download. Read the online documentation, or try the C# and VB.NET online demos.
Common questions about formats, dependencies and licensing.
DataTable: LoadDataTable loads its data into a worksheet, and GetDataTable gets the data of a range back into a DataTable.Download the free trial with C# and VB.NET samples for ASP.NET and Windows Forms and the API documentation. When you are ready, license ExpertXLS on the pricing page.