New to Telerik Document ProcessingStart a free 30-day trial

Merge Xlsx files in a single Workbook

Updated on Apr 24, 2026
Product VersionProductAuthor
RadSpreadProcessing2021.1.113Dimitar Karamfilov

Description

You have a multiple Xlsx files and you want to merge them in single file.

Solution

You can iterate all files, import them, and copy their worksheets in a new Workbook.

Merge multiple worksheet in a single Workbook

csharp

    List<string> files = new List<string>();
    files.Add("Book1.xlsx");
    files.Add("Book2.xlsx");

    var provider = new XlsxFormatProvider();

    var workbook = new Workbook();

    foreach (string fileName in files)
    {
        var newSheet = workbook.Worksheets.Add();
        newSheet.Name = fileName;
        var currentFile = File.ReadAllBytes(fileName);
        var importedXlsx = provider.Import(currentFile);
        newSheet.CopyFrom(importedXlsx.Worksheets[0]);
    }

    var resultXlsx = provider.Export(workbook);
    File.WriteAllBytes("result.xlsx", resultXlsx);
In this article
DescriptionSolution
Not finding the help you need?
Contact Support