Microsoft® Excel File Splitting via .NET

Split single Excel document into different files using C# code within .NET based applications

 

.NET Excel Library is capable to split Excel document into multiple spreadsheets within .NET based applications. Supported file formats include XLS, XLSX, XLSB, XLSM, ODS.

Split Excel Document into Multiple Files

The simplest way to split Excel files sheet wise is, Accessing all sheets via Worksheets , Iterating through each sheet and calling the Copy method. Finally saving it into a specified path.

  • Load the Excel file with full path using Workbook class .
  • Iterate throug each sheet
  • Create a new Workbook class object
  • Copy the sheet via Copy method
  • Call the Save() method and pass the file name (full path) having relevant SaveFormat.
C# Code to Split Excel Files
 

Split Excel Worksheet into Panes

For splitting worksheet window into panes, API provides Split method of worksheet class, that provides the splitted view of worksheet. To remove splitted view API provides RemoveSplit method . Finally save it into a specified path.

C# Code to Split Excel Worksheet Window
C# Code to Remove Splitted Pan View