New to Telerik Document Processing? Download free 30-day trial

Merge Xlsx files in a single Workbook

Product Version Product Author
RadSpreadProcessing 2021.1.113 Dimitar Karamfilov


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


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

Merge multiple worksheet in a single Workbook

List<string> files = new List<string>(); 
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); 
var resultXlsx = provider.Export(workbook); 
File.WriteAllBytes("result.xlsx", resultXlsx); 
In this article