Skip to content

Instantly share code, notes, and snippets.

@kappa7194
Created May 28, 2013 10:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kappa7194/5661804 to your computer and use it in GitHub Desktop.
Save kappa7194/5661804 to your computer and use it in GitHub Desktop.
How to generate an Excel workbook.
namespace Playground.Sandbox
{
using System.IO;
using OfficeOpenXml;
public static class Program
{
public static void Main()
{
var file = new FileInfo("MyFile.xlsx");
using (var package = new ExcelPackage(file))
{
var sheet = package.Workbook.Worksheets.Add("MySheet");
sheet.Cells[1, 1].Value = "MyValue";
package.Save();
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment