The following example shows how to read XLS, XLSX, ODS, CSV, and HTML files by using only the GemBox.Spreadsheet .NET component.
GemBox.Spreadsheet is a C# / VB.NET component that provides a simple and efficient way to read, write, convert, and print native Microsoft Excel (XLSX, XLS) and other spreadsheet (ODS, CSV) formats and various document formats (HTML, PDF, XPS) from .NET applications without the need for Microsoft Excel on either the developer or client machines.
GemBox.Spreadsheet Free is free of charge, while GemBox.Spreadsheet Professional is a commercial version that is licensed per developer.
For more information, see GemBox.Spreadsheet Features or try our examples.
The example below reads an Excel file (in XLS format) and shows a Message Box with value from cell “A1”:
// Load Excel file. var workbook = ExcelFile.Load("Workbook.xls"); // Select active worksheet. var worksheet = workbook.Worksheets.ActiveWorksheet; // Display the value of first cell in MessageBox. MessageBox.Show(worksheet.Cells["A1"].GetFormattedValue());
Visual Basic .NET code:
' Load Excel file. Dim workbook = ExcelFile.Load("Workbook.xls") ' Select active worksheet. Dim worksheet = workbook.Worksheets.ActiveWorksheet ' Display the value of first cell in MessageBox. MessageBox.Show(worksheet.Cells("A1").GetFormattedValue())
Download the Free Version of GemBox.Spreadsheet
GemBox.Spreadsheet Free delivers the same performance and set of features as the Professional version. However, the Free version is limited to 150 rows per sheet. You can use the free version for any purpose, including commercial applications.
If you want to see how fast and efficient GemBox.Spreadsheet performs for large files, you can enable Trial mode right from within the free version.
Get the GemBox.Spreadsheet Professional for unlimited use
GemBox.Spreadsheet is a standalone .NET component for fast reading, writing, editing, converting and printing of XLSX, XLS, ODS, CSV, HTML, PDF, and XPS files using C# or VB.NET with one simple API.