How to retrieve value from formula cell in excel?

Answered How to retrieve value from formula cell in excel?

  • 2012年7月20日 上午 09:48
     
     

    How to retrieve value from formula cell in excel? 

    I tryed this cell.CellFormula.CalculateCell.InnerText, but cell.CellFormula.CalculateCell = null.


所有回覆

  • 2012年7月20日 下午 02:46
    版主
     
     已答覆

    Hi Maxim

    See this discussion that is about the same topic as your question:
    http://social.msdn.microsoft.com/Forums/en-US/oxmlsdk/thread/da953b03-63c5-4eb9-aed2-db726d965c91

    To summarize: this property does not perform any calculations within Open XML. The workbook needs to be opened in an Excel environment in order to get an automatic calculation. If you need to have the calculation performed as part of the Open XML processing, then your code needs to perform the calculation and insert the result into the XML.


    Cindy Meister, VSTO/Word MVP

  • 2012年7月21日 上午 06:51
     
     
    Thank you for the answer.