GemBox Retrieving Calculated Values From a Spreadsheet or Flexcel

前端 未结 2 1099
遇见更好的自我
遇见更好的自我 2021-01-24 10:29

According to their docs: GemBox.Spreadsheet can read and write formulas, but can not calculate formula results. When you open a XLS file in MS Excel, formula results will be cal

相关标签:
2条回答
  • 2021-01-24 11:07

    What is your actual question?

    Cells have two properties: values and formulas. What you're seeing is value beeing recalculated by Excel on the fly. Gembox, as you said, doesn't recalculate the values.

    If you need formula evaluation, look for another library, for example Apache POI.

    0 讨论(0)
  • 2021-01-24 11:22

    EDIT 28-09-2016:
    We have released a new version of GemBox.Spreadsheet (version 4.1) in which we implemented a support for cell formula calculation, see the version history page.
    Also, you can find the calculation example here.

    ORIGINAL ANSWER
    GemBox.Spreadsheet currently supports only values that are calculated by the Excel (so if file is saved by the MS Excel, we can read formula values). GemBox.Spreadsheet does not have its own calculation engine.

    To read formula values in XLS format use ExcelFile.LoadXls overload that accepts XlsOptions enumeration and use XlsOptions.PreserveWorksheetRecords or XlsOptions.PreserveAll.

    To read formula values in XLSX format use ExcelFile.LoadXlsx method with XlsxOptions enumeration values XlsxOptions.PreserveKeepOpen or XlsxOptions.PreserveMakeCopy.

    0 讨论(0)
提交回复
热议问题