Merge XLTM

How to merge XLTM files in C#

GroupDocs.Merger allows developers to merge XLTM files when it’s needed to organize multiple XLTM 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 XLTM 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 XLTM files with several lines of C# code:

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

About XLTM File Format

The XLTM file extension represents files that are generated by Microsoft Excel as Macro-enabled template files. XLTM files are similar to XLTX in structure other than that the later doesn’t support creating template files with macros. Such template files are used to generate and set the layout, formatting, and other settings along with the macros to facilitate creating similar XLSX files then.

Code Examples

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

Merge XLTM Live Demo

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

“Merge XLTM”