Simple Excel interface allows you to read a WorkSheet and write a new Excel file.
Using GetExcelRowEnumerator it will return a IEnumerable with the entire contents of the sheet
publicstaticIEnumerable<List<dynamic>>GetExcelRowEnumerator(intsheetNumber,stringpath,intRowStart=1)Example:
varExcelSheetOne=Interface.GetExcelRowEnumerator(1,@"c:\ExcelFile.xlsx");It reads the number one card of "Excel File.xlsx" and return a list.
Using SetExcelRow passing as argument a list of a class, a new Excel will open with the printed list
publicstaticvoidSetExcelRow<T>(List<T>data)Example:
usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingExcelWs;namespaceTest{classProgram{staticvoidMain(string[]args){List<Person>Users=newList<Person>();for(inti=0;i<10;i++){Users.Add(newPerson(){Id=i,Name="Claudio"});}Interface.SetExcelRow<Person>(Users);}publicclassPerson{publicintId{get;set;}publicstringName{get;set;}}}}