XDoc.Excel is a FREE C# Office Excel library to read, convert, edit, create MS-Excel (.xlsx) documents in .NET projects. XDoc.Excel from RasterEdge is an advanced Microsoft Excel library : * It is FREE * Generate Excel from scratch * Convert Excel to PDF, SVG, HTML, multi-page TIFF, JPG, PNG and many raster image formats * Edit, process, merge Excel document Compatible with * .NET Standard 2.0 * .NET 8, .NET 7, .NET 6, .NET 5, .NET Core 3.x & 2.x * .NET Framework 4.x * Windows, MacOS, Linux, Docker, Azure Online Documents * C# How to Guide : https://www.rasteredge.com/how-to/csharp-imaging/excel-reading/ * Email : support@rasteredge.com
$ dotnet add package XDoc.ExcelOnce installed the package, you can use the following C# code to combine multiple Excel files into one.
String inputFilePath1 = Program.RootPath + "\\" + "1.xlsx";
String inputFilePath2 = Program.RootPath + "\\" + "2.xlsx";
String outputFilePath = Program.RootPath + "\\" + "Output.xlsx";
String[] inputFilePaths = new String[2] { inputFilePath1, inputFilePath2 };
// Combine two Excel files.
XLSXDocument.CombineDocument(inputFilePaths, outputFilePath);