EasyXLS

Import XLSM file in .NET, Java and other programming languages

EasyXLS™ library allows you to import data from an XLSM file or other sheet elements like cell formatting, charts, pivot tables, comments, images and others.

EasyXLS can be successfully used to also import large XLSM files having big volume of data with fast importing time.

EasyXLS allows loading an XLSM document. Once the XLSM is loaded in memory, the user can process data, add more features to the file (like formulas, cell formatting, comments, hyperlinks, images, data validations, page setup, charts, macro, etc), and save the file back in XLSM format or other format (XLS, XLSB, XML Spreadsheet, XML, TXT, CSV or HTML).
It can be used to load an already formatted XLSM file as a template, add data and save back the file in XLSM format. In this way, a lot of written code that formats the XLSM file can be avoided and the macros are preserved.

EasyXLS permits you to import Excel files without Excel installed, without Interop, without OLEDB or any other additional software installed.

Import entire XLSM file

The below source code sample is a common code about how to import an XLSM file. The source code shows how to load and import an XLSM file that is used as a base template, add more data to the XLSM file and save the new workbook.
After that, the best techniques about importing data from XLSM file like importing Excel data to DataTable, GridView, DataGridView, DataSet, ResultSet, DataGrid and List are shown.

C#.NET
VB.NET
C++
Java
PHP
ASP
VB6
VBS
Coldfusion
Python

The screen shots below provide an example of the imported XLSM file, modified and saved back to another XLSM file. The file has two worksheets (First Tab and Second Tab) and contains a VBA project and macros. The data is added to the second worksheet.

Imported XLSM file first sheet

   and:

Imported XLSM file second sheet

Import data from XLSM file

EasyXLS allows you to import data from an Excel sheet or from the active Excel sheet. The entire sheet data or only data from ranges of cells can be imported.

C#.NET
VB.NET
C++.NET
Java
PHP
ASP
C++
VB6
VBS
Coldfusion
Python

Import data from XLSM file having one sheet

Importing data from an XLSM file, if the XLSM file has only one sheet, is the easiest approach. The Excel data can be imported with one single line of code using ExcelDocument.easy_ReadXLSXActiveSheet_AsDataSet method.
The above code sample shows how to achieve this goal.

Import data from XLSM file having multiple sheets

There are three approaches for importing data from an XLSM file with multiple sheets.

I. Usually the first sheet is the active sheet inside an XLSM file. If this is your case or if you are importing data from another active sheet use ExcelDocument.easy_ReadXLSXActiveSheet_AsDataSet method.

II. For importing data from an Excel sheet and the name of the sheet is known, EasyXLS recommends the use of ExcelDocument.easy_ReadXLSXSheet_AsDataSet method.

III. For importing data from an Excel sheet and the name of the sheet is not known, the first step is to find the sheet name by using ExcelDocument.easy_ReadXLSXFile_SheetNames method.
Then, import the sheet data using ExcelDocument.easy_ReadXLSXSheet_AsDataSet method.

Import data from range of Excel cells

EasyXLS enables you to import Excel data either from the entire sheet or from a range of cells. Importing only a range of cells is a very useful option especially for large XLSM files because it reduces the speed of the import process.

In order to import multiple cell ranges at once from Excel sheet, the range parameter must be passed to the method as union of ranges (multiple ranges separated by comma).

All the methods that allow importing XLSM file to DataSet or ResultSet have parameters that permit importing only ranges of cells.

C#.NET
VB.NET
C++.NET
Java
PHP
ASP
C++
VB6
VBS
Coldfusion
Python

Import all XLSM file structures

EasyXLS allows you to import the whole XLSM file with sheets, data inside sheets, formulas, cell formatting, comments, hyperlinks, images, data validation, page setup, macros, groups, filters, charts, pivot tables and pivot charts.

The first above code sample shows how to achieve this goal.

Import XLSM file to SQL table in C# and VB.NET

EasyXLS library can be used to import Excel data to database like SQL Server, MySQL, Oracle, MS Access or any other database.

Import XLSM file to DataTable in C# and VB.NET

EasyXLS library can be used to import Excel sheets into DataTable. The DataTable can be the used as data source of a GridView, DataGridView, DataGrid or for any other purposes.

Import XLSM file to GridView in C# and VB.NET from ASP.NET

EasyXLS library can be used to import Excel data into GridView from ASP.NET web applications.

Import XLSM file to DataGridView in C# and VB.NET

EasyXLS library can be used to import Excel data into DataGridView from windows applications and windows forms.

Import XLSM file to DataSet in C# and VB.NET

EasyXLS library can be used to import Excel sheets into DataSet from windows applications, ASP.NET pages or console applications.

Import XLSM file to ResultSet in Java

EasyXLS library can be used to import Excel sheets into ResultSet from Java applications.

Import XLSM file to list

EasyXLS library can be used to import Excel sheets into lists of data.

Import XLSM file to DataGrid in C# and VB.NET

EasyXLS library can be used to import Excel data into DataGrid from windows applications and windows forms.

Import password protected XLSM file

EasyXLS allows importing encrypted Excel file. The Excel file can be password protected.

Getting started with EasyXLS Excel library

To download the trial version of EasyXLS Excel Library, press the below button:

Download EasyXLS™ Excel Library for .NET and Java

If you already own a license key, you may login and download EasyXLS from your account.



Available for: Professional, Excel Reader
Go to top

EasyXLS Excel libraries:

.NET
.NET Excel Library
full .NET version to import, export or convert Excel files
.NET Excel Reader
.NET version to read and import Excel files
COM+ Excel Library
full COM+ version to import, export or convert Excel files
COM+ Excel Reader
COM+ version to read and import Excel files
-
Java
Java Excel Library
full Java version to import, export or convert Excel files
Java Excel Reader
Java version to read and import Excel files
Download EasyXLS™ Excel Library for .NET and Java

File formats:

MS Excel 97 - 2003
MS Excel 2007 - 2019
MS Excel 2021
Office 365
XLSXXLSMXLSBXLS
XMLHTMLCSVTXT