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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Using excel file for calculation.

Thread ID:





97021 Oct 20,2010 03:55 PM UTC Nov 28,2014 11:29 AM UTC WinForms 3
Tags: XlsIO
Attila Kenyhercz
Asked On October 20, 2010 03:55 PM UTC

I want to implement a code, which writes some values into an excel file, than reads a cell which is a formula calculates values from previously entered data.

I create an excel file like this:
A1 = "1"
A2 = "2"
A3 = A1 + A2 // = "3"

then I open it from my application, and I set the new values:

A1 = 4
A2 = 6

after this I read the value of A3 and it is still "3".
It appears that the value of the A3 cell is not recalculated.

My question would be, how to force Syncfusion.XlsIO to recalculate the formulas.

The code I have is:
#using Syncfusion.XlsIO;

ExcelEngine excelEngine = new ExcelEngine();
IApplication application = excelEngine.Excel;

application.DefaultVersion = ExcelVersion.Excel2007;

IWorkbook workbook = excelEngine.Excel.Workbooks.Open("test.xls", ExcelOpenType.Automatic);

IWorksheet sheet = workbook.Worksheets[0];

sheet.Range["A1"].Value = "4";
sheet.Range["A2"].Value = "6";

I have referenced the
Core, Compression.Base, XlsIO.Windows, XsIO.Base

Thank you for your help...

Sathish Babu R [Syncfusion]
Replied On October 21, 2010 03:54 AM UTC

Hi Attila,

Thank you for your interest in Syncfusion products.

In our XlsIO, We can calculate the formula at runtime using Essential Calculate which is already integrated with the Essential XlsIO. We have created the sample with custom class (XlsIOCalcWorkbook) to calculate the formula at runtime. Could you please try the sample and let us know if this helps you.


Please, let us know if this helps you.


Riccardo De Agostini
Replied On November 27, 2014 07:57 AM UTC

I'm having a very similar problem. Unfortunately, the link to the sample is dead. Can you make the sample available again?

Thanks and best regards
Riccardo De Agostini

Sudha Ramachandran [Syncfusion]
Replied On November 28, 2014 11:29 AM UTC

Hi Riccardo,


The scenario is similar to the query reported by you in the forum 117677, for which we have provided a sample. Please have a follow-up in the mentioned forum and get back to us in that if you need any clarification.



Sudha Ramachandran


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon