Merge XLS

How to merge XLS files in C#

GroupDocs.Merger allows developers to merge XLS files when it’s needed to organize multiple XLS files into single document or send fewer attachments etc. And you can do this without¬†any third-party software or manual work involved. With GroupDocs.Merger it is possible to combine XLS documents of any size and structure - all text, images, tables, graphs, forms and other content will be preserved.

The following example demonstrates how to merge XLS files with several lines of C# code:

  • Create an instance of Merger class and pass source XLS file path as a constructor parameter. You may specify absolute or relative file path as per your requirements.
  • Add another XLS file to merge with Join method. Repeat this step for other XLS documents you want to merge.
  • Call Merger class Save method and specify the filename for the merged XLS file as parameter.
// Load the source XLS file
using (Merger merger = new Merger(@"c:\sample1.xls"))
{
    // Add another XLS file to merge
    merger.Join(@"c:\sample2.xls");
    // Merge XLS files ans save result
    merger.Save(@"c:\merged.xls");
}

About XLS File Format

Files with XLS extension represent Excel Binary File Format. Such files can be created by Microsoft Excel as well as other similar spreadsheet programs such as OpenOffice Calc or Apple Numbers. File saved by Excel are known as Workbook where each workbook can have one or more worksheets. Data is stored and displayed to users in table format in worksheet and can span numeric values, text data, formulas, external data connections, images and charts.

Code Examples

Please find more use-cases and complete C# sources of our backend and frontend examples and try them for free!

Merge XLS Live Demo

GroupDocs.Merger for .NET provides an online XLS Merger App, which allows you to try it for free and check its quality and accuracy.

“Merge XLS”