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.

Try ByteScout Spreadsheet SDK today: Get 60 Day Free Trial or sign up for Web API

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"); } } }

Try ByteScout Spreadsheet SDK today: 60 Day Free Trial (on-premise version) or sign up for Web API (on demand version)

VIDEO

ON-PREMISE VERSION

Get 60 Day Free Trial or Visit ByteScout Spreadsheet SDK page

Explore ByteScout Spreadsheet SDK documentation

WEB API

Sign Up for free Web API key

Explore Web API Documentation

Tutorials:

prev
next