How can I check the version of Excel files in C#?

前端 未结 3 1111
臣服心动
臣服心动 2021-01-25 00:44

I need to differentiate that a selected file is created with Excel 2010 or Excel 2013 version of a selected Excel file and Excel application on server must match in order to con

3条回答
  •  迷失自我
    2021-01-25 01:11

    found a simple solution with OLE File Property Reader

    var doc = new OleDocumentPropertiesClass();
    doc.Open(ExcelFilePath, false, dsoFileOpenOptions.dsoOptionDefault);
    string DocFileVersion = doc.SummaryProperties.Version.ToString();
    

    this will return version of Application Version of excel file...

提交回复
热议问题