Created
May 28, 2013 10:16
-
-
Save kappa7194/5661804 to your computer and use it in GitHub Desktop.
How to generate an Excel workbook.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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