combine excel files

How to Merge Excel files with .NET Cloud SDK.

The challenge of efficiently handling and consolidating information stored across multiple Excel workbooks has become a common yet critical concern. Therefore, this article embarks on a journey to address this necessity, unveiling the transformative capabilities of merging Excel workbooks using .NET REST API. Owing to the RESTful architecture of the API, you do not need to install it on local system but accomplish all your requirements by sending a request to the Cloud instance. Let’s delve into the details where this capability proves indispensable, from financial analyses requiring the amalgamation of budget sheets to project management scenarios necessitating the integration of diverse data streams.

REST API to Combine Excel Files

The process of merging Excel workbooks is streamlined and efficient with the utilization of Aspose.Cells Cloud SDK for .NET. By leveraging the simplicity of .NET REST API calls, you gain the ability to combine and consolidate Excel files effortlessly. Whether managing financial reports, combining project-related data, or merging datasets for analysis, Aspose.Cells Cloud SDK ensures precision and reliability throughout the merging process. Let’s explore the features, benefits, and practical implementation of merging Excel workbooks using Aspose.Cells Cloud SDK for .NET, as it provides a robust solution for enhancing data management workflows.

The first step is to add its reference in .NET application. Therefore, search Aspose.Cells-Cloud in NuGet packages manager and click the Add Package button. Secondly, obtain your client credentials from cloud dashboard. If you do not have an existing account, simply create a free account by following the instructions specified in the quick start article.

Combine Excel Files in C# .NET

We have learned that by understanding and harnessing the capabilities of .NET REST API, you can unlock a new level of data organization, accessibility, and analytical insight. So let’s look into the details on how to merge Excel files C# .NET.

CellsApi cellsInstance = new CellsApi(clientID, clientSecret);

Create an object of CellsApi class where we pass client credentials as arguments.

cellsInstance.UploadFile(dictionary.Key, dictionary.Value);

Read the input Excel files and upload to cloud storage.

cellsInstance.CellsWorkbookPostWorkbooksMerge(first_Excel, second_Excel, folder: null, storageName: null, mergedStorageName: null);

Call the API to combine worksheets of second Excel file to first excel workbook. The merged Excel is then uploaded to cloud storage.

combine excel files

A preview of merged Excel files with .NET Cloud SDK.

The input Excel workbooks used in above example can be downloaded from:

Merge Excel Files using cURL Commands

The powerful capability of merging Excel workbooks can be seamlessly achieved by leveraging the combined strength of Aspose.Cells Cloud and cURL commands. By utilizing cURL commands to interact with the Aspose.Cells Cloud API, you can effortlessly initiate the process of merging Excel workbooks. Furthermore, this approach provides you with a straightforward and effective solution for consolidating Excel files, ensuring a seamless and reliable experience.

The first step in this approach is to generate a JWT access token using the following command:

curl -v "https://api.aspose.cloud/connect/token" \
 -X POST \
 -d "grant_type=client_credentials&client_id=921363a8-b195-426c-85f7-7d458b112383&client_secret=2bf81fca2f3ca1790e405c904b94d233" \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Accept: application/json"

Now, please execute the following command to merge Excel files using C# .NET. The following request expects the input Excel files to be already available in the cloud storage.

curl -v "https://api.aspose.cloud/v3.0/cells/{inputFile1}/merge?mergeWith={inputFile2}" \
-X POST \
-H "accept: application/json" \
-H "authorization: Bearer {accessToken}" \
-d {}

Replace inputFile1 & inputFile2 with the names of input Excel workbooks and accessToken with a JWT access token generated above.

Conclusion

In conclusion, the dynamic landscape of data transformation accommodates two powerful approaches to convert JSON to PDF, using the feature-rich Aspose.Cells Cloud SDK for .NET and the scriptable efficiency of cURL commands. Whether you opt for the comprehensive toolkit and granular control offered by Aspose.Cells Cloud SDK, or the simplicity and cross-platform compatibility of cURL commands. Nonetheless, both approaches provide a seamless transformation of JSON data into polished and universally accessible PDF documents.

We highly recommend visiting the following blogs: