How to create a blank Excel XLSX spreadsheet in C# .NET Framework

Cloudmersive
1 min readFeb 6, 2020

--

Want to implement Excel file creation in a hurry? We’ve got you covered. You’ll be done in a matter of minutes!

Let us get started by using NuGet to install our API client. To do this, simply run this command in your Package Manager console.

Install-Package Cloudmersive.APIClient.NET.DocumentAndDataConvert -Version 2.2.0

Now just run EditDocumentXlsxCreateBlankSpreadsheet with the following code excerpt.

using System;using System.Diagnostics;using Cloudmersive.APIClient.NET.DocumentAndDataConvert.Api;using Cloudmersive.APIClient.NET.DocumentAndDataConvert.Client;using Cloudmersive.APIClient.NET.DocumentAndDataConvert.Model;namespace Example{public class EditDocumentXlsxCreateBlankSpreadsheetExample{public void main(){// Configure API key authorization: ApikeyConfiguration.Default.AddApiKey("Apikey", "YOUR_API_KEY");// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed// Configuration.Default.AddApiKeyPrefix("Apikey", "Bearer");var apiInstance = new EditDocumentApi();var input = new CreateBlankSpreadsheetRequest(); // CreateBlankSpreadsheetRequest | Document input requesttry{// Create a blank Excel XLSX spreadsheetCreateBlankSpreadsheetResponse result = apiInstance.EditDocumentXlsxCreateBlankSpreadsheet(input);Debug.WriteLine(result);}catch (Exception e){Debug.Print("Exception when calling EditDocumentApi.EditDocumentXlsxCreateBlankSpreadsheet: " + e.Message );}}}}

And that’s a wrap. Our blank XLSX file is ready and waiting to be populated. Our other functions cover XLSX editing as well, allowing you to add and delete cell information as needed.

--

--

Cloudmersive
Cloudmersive

Written by Cloudmersive

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

No responses yet