ByteScout Spreadsheet SDK - C# - Create Worksheets - ByteScout

ByteScout Spreadsheet SDK – C# – Create Worksheets

  • Home
  • /
  • Articles
  • /
  • ByteScout Spreadsheet SDK – C# – Create Worksheets

How to create worksheets in C# using ByteScout Spreadsheet SDK

How to create worksheets in C#

These sample source codes on this page below are demonstrating how to create worksheets in C#. ByteScout Spreadsheet SDK is the SDK to create, read, modify and calculate spreadsheets. Formula calculations are supported, import and export to and from JSON, CSV, XML, databases, arrays and you can use it to create worksheets with C#.

You will save a lot of time on writing and testing code as you may just take the C# code from ByteScout Spreadsheet SDK for create worksheets below and use it in your application. In order to implement the functionality, you should copy and paste this code for C# below into your code editor with your app, compile and run your application. Code testing will allow the function to be tested and work properly with your data.

Free trial version of ByteScout Spreadsheet SDK is available on our website. Documentation and source code samples are included.

On-demand (REST Web API) version:
 Web API (on-demand version)

On-premise offline SDK for Windows:
 60 Day Free Trial (on-premise)

Program.cs
      
using System; using System.Collections.Generic; using System.Text; using Bytescout.Spreadsheet; using System.IO; using System.Diagnostics; namespace Worksheets { class Program { static void Main(string[] args) { // Create new Spreadsheet Spreadsheet document = new Spreadsheet(); // Add worksheets Worksheet worksheet1 = document.Workbook.Worksheets.Add("Demo worksheet 1"); Worksheet worksheet2 = document.Workbook.Worksheets.Add("Demo worksheet 2"); // Get worksheet by name Worksheet worksheetByName = document.Workbook.Worksheets.ByName("Demo worksheet 2"); // Set cell values worksheet1.Cell(0, 0).Value = "This is Demo worksheet 1"; worksheetByName.Cell(0, 0).Value = "This is Demo worksheet 2"; // delete output file if exists already if (File.Exists("Worksheets.xls")){ File.Delete("Worksheets.xls"); } // Save document document.SaveAs("Worksheets.xls"); // delete output file if exists already if (File.Exists("Output.xls")){ File.Delete("Output.xls"); } // open generated XLS document in default program Process.Start("Worksheets.xls"); } } }

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Spreadsheet SDK Home Page

Explore ByteScout Spreadsheet SDK Documentation

Explore Samples

Sign Up for ByteScout Spreadsheet SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

VIDEO

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Spreadsheet SDK Home Page

Explore ByteScout Spreadsheet SDK Documentation

Explore Samples

Sign Up for ByteScout Spreadsheet SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next