Create XLSX - C#
Spreadsheet SDK sample in C# demonstrating ‘Create XLSX’
Program.cs
using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using Bytescout.Spreadsheet;
using System.IO;
namespace CSharp
{
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!";
if (File.Exists("Output.xlsx"))
{
File.Delete("Output.xlsx");
}
// Save document
document.SaveAs("Output.xlsx");
// Close Spreadsheet
document.Close();
// open generated XLS document in default program
Process.Start("Output.xlsx");
}
}
}