Last active
November 30, 2016 18:52
-
-
Save vivainio/c8145f0029cab5188320868873f01dd5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| open System.IO | |
| open OfficeOpenXml | |
| open System.Data | |
| [<EntryPoint>] | |
| let main argv = | |
| let f = FileInfo("test.xlsx") | |
| use p = new ExcelPackage(f) | |
| let ws = p.Workbook.Worksheets.Add("testi") | |
| use dt = new DataTable("mundata") | |
| dt.Columns.AddRange( [| new DataColumn("foo"); new DataColumn("bar") |] ) | |
| let row = dt.NewRow() | |
| row.["foo"] <- "12" | |
| row.["bar"] <- "13" | |
| dt.Rows.Add(row) | |
| let range = ws.Cells.[1,1,2,5] | |
| let tab = range.LoadFromDataTable(dt, true) | |
| p.Save() | |
| 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment