Generate Excel in C# .NET with Bytescout Spreadsheet SDK - ByteScout

Generate Excel in C# .NET with Bytescout Spreadsheet SDK

  • Home
  • /
  • Generate Excel in C# .NET with Bytescout Spreadsheet SDK

Generate Excel XLS, XLSX, CSV files
in C# .NET applications.

Bytescout Spreadsheet SDK is a clean and simple API to generate Excel files in C# .NET applications.

Almost in every business application we need to have the ability to create Excel files. Using Bytescout Spreadsheet SDK is a simple way of Excel generation.

With the Spreadsheet SDK, you can generate Excel files in Visual C#.

Generate Excel – C#:

using System;
using System.Collections.Generic;
using System.Text;
using Bytescout.Spreadsheet;
using System.IO;
using System.Diagnostics;

namespace HelloWorld
{
    class Program
    {
        static void Main(string[] args)
        {
            // Create new Spreadsheet
            Spreadsheet document = new Spreadsheet();

            // Add new worksheet
            Worksheet worksheet = document.Workbook.Worksheets.Add("HelloWorld");

            // Set cell value
            worksheet.Cell(0, 0).Value = "Hello, World!";
            // delete output file if exists already
            if (File.Exists("Output.xls")){
                File.Delete("Output.xls");
            }

            // Save document
            document.SaveAs("Output.xls");

            // Close Spreadsheet
            document.Close();

            // open generated XLS document in default program
            Process.Start("Output.xls");
        }
    }
}

Find all sample source codes for C# .NET in a free trial of Spreadsheet SDK. Download now!

More about Bytescout Spreadsheet SDK benefits

[socialpug_share]

Tutorials: