C#:Check excel file version -


this question has answer here:

is there way can version of excel file?like if it`s of 2003/2007/2010. not local system version. like, have excel file saved in folder ex: c:\newfolder\qq.xls

i have check file's version,if 2003/2007/2010.

please suggest if there`s way.thanks lot in advance.

filestream stream = null; iexceldatareader excelreader = null; dataset exceldataset = null;  using (stream = file.open(filepath, filemode.open, fileaccess.read)) {     if (filepath.endswith(".xlsx"))     {         //reading openxml excel file (2007 format; *.xlsx)         excelreader = excelreaderfactory.createopenxmlreader(stream);     }     else //.xls     {         //reading binary excel file ('97-2003 format; *.xls)         excelreader = excelreaderfactory.createbinaryreader(stream);     }     excelreader.isfirstrowascolumnnames = true;     exceldataset = excelreader.asdataset(); } 

iexceldatareader http://exceldatareader.codeplex.com/


Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -