I would urge against using OleDB, especially if its going to be run on a server. It only support Excel 97-2003 (xls) files.Īn extension to ExcelPackage. In addition to Excel (97-2010) it also supports Word and PowerPoint files. It is also easy like the other ones I've mentioned. There is another project, ExcelDataReader, that seems to have the ability to handle both formats. get the first worksheet in the workbookĮxcelWorksheet worksheet = Ĭonsole.WriteLine("Cell( // the using statement calls Dispose() which closes the package. Sample using ExcelPackage: using (ExcelPackage xlPackage = new ExcelPackage(existingFile)) Var content = sheet.getCell(colIndex, rowIndex).getContents() Sample using CSharpJExcel: Workbook workbook = Workbook.getWorkbook(new System.IO.FileInfo(fileName)) They have absolutely no dependency on anything. I highly recommend CSharpJExcel for reading Excel 97-2003 files (xls) and ExcelPackage for reading Excel 2007/2010 files (Office Open XML format, xlsx).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |