public static List <string> GetExcelDataSheets(string fileName) { List <string> list = new List <string>(); Excel.Import i = new Excel.Import(fileName); try { list.AddRange(i.GetSheetNames()); } catch (Exception e) { throw e; } return(list); }
public static DataTable GetExcelDataFromFile(string fileName, string sheet) { Excel.Import i = new Excel.Import(fileName, sheet.Replace("'", "")); return(i.Query()); }