Last active
August 29, 2015 14:08
-
-
Save toinetoine/816f75d62fcec9ee73a9 to your computer and use it in GitHub Desktop.
Printing cell A1 from an excel sheet named 'Sheet1' of the workbook 'ExcelWorkbook.xlsx' using Koogra in .NET
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
/* | |
* Must have refrences the dlls: | |
* Net.SourceForge.Koogra.dll (here: http://www.antoinedahan.com/blog/ReadingExcelFilesWithKoogra/Net.SourceForge.Koogra.dll) | |
* Ionic.Utils.Zip.dll (here: http://www.antoinedahan.com/blog/ReadingExcelFilesWithKoogra/Ionic.Utils.Zip.dll) | |
*/ | |
using Koogra = Net.SourceForge.Koogra; | |
//Grab the workbook | |
Koogra.IWorkbook workbook = Koogra.WorkbookFactory.GetExcel2007Reader("ExcelWorkbook.xlsx"); | |
//Grab the worksheet | |
Net.SourceForge.Koogra.IWorksheet worksheet = workbook.Worksheets.GetWorksheetByName("Sheet1"); | |
//Write the contents of cell A1 (at row index 0 and cell index 0) | |
Console.Write((string)(worksheet.Rows.GetRow(0).GetCell(0).GetFormattedValue())); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment