I have an ASP.NET Web API and need to implement this feature for a future version. Specifically:
- Several .xls files will be placed in a temporary folder. They have the same width but different heights, as well as different row and column sizes.
- The files need to be appended into one .xls file
- The final excel cannot have multiple worksheets.
- The Office Interop libraries cannot be used because Office is not installed and cannot be instaled on the deployment environment.
Is there a way to do this without using the office interop libraries as specified, or any paid third party libraries (free third party libraries are more than welcome) ?
Install Spire.XLS from NuGet: Install-Package Spire.XLS -Version 9.6.7
Spire.XLS provides two ways to merge excel files into a single excel worksheet:
1. Merge excel with styles using CellRange.Copy()
Reference: How to merge multiple worksheets to a single worksheet with styles
2. Merge excel without styles using DataTable
Reference: How to merge 3 Sheets from different Excel files into one sheet with C#