We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to retrieve cell value without enabling sheet calculations in C#, VB.NET?

This article explains how to retrieve the cell value without enabling sheet calculations using XlsIO.

There can be situations where the formula value or the last calculated value in a cell is required without actually recalculating sheet formulas through EnableSheetCalculations. This can be achieved using DisplayText property in worksheet range.

The below table illustrates the behavior of DisplayText property with respect to enabling sheet calculations.

 

DisplayText while opening an existing workbook

DisplayText while creating a new workbook

Without EnableSheetCalculation

Always returns cell value with its number format.

Returns 0, if cell has a formula

Returns cell value with number format, if cell does not have formula

With EnableSheetCalculation

Returns evaluated value with number format, if cell has a formula

Returns cell value with number format, if cell does not have formula

Returns evaluated value with number format, if cell has a formula

 

Code snippet to use DisplayText property

Download input sample with data

Download complete sample

To know more about enabling and disabling sheet calculations, please refer the documentation.

The following complete code snippet explains how to retrieve the formula value in cell without enabling sheet calculations using XlsIO.

C#

VB

 

Article ID: Published Date: Last Revised Date: Platform: Control:
8876 06/26/2018 06/26/2018 Windows Forms XlsIO
Did you find this information helpful?
Add Comment
You must log in to leave a comment

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.