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. Image for the cookie policy date

values in formulas are not updated and save error

Hi,

I've an excel with formulas, and I've two problems

1. When I insert data in cell, formulas values are not updated
2. When I close de worksheet saving, the worksheet is not saved

I attach an example. In the example, if I set SI value in B2 cell, B9 cell has 100 value, else 500.

So, in the code, I set SI value, but the B9 value is 500 not 100.

Also, if I do workbook.save(true) (Close the workbook and save) B2 cell is empty, but if I save with other filename, B2 has SI value




Attachment: WebApplication5_aa908199.zip

1 Reply

KK Konduru Keerthi Konduru Ravichandra Raju Syncfusion Team December 12, 2019 12:08 PM UTC

Hi Manalo, 

Greetings from Syncfusion. 

Query 
Answer 
1. When I insert data in cell, formulas values are not updated 
From the project you have shared us, we found that you are trying to access FormulaStringValue and hence the formula values are not updated. 

We suggest you to use CalculatedValue to get the updated formula values. 

Code Snippet: 

string value; 
value = sheet.Range["B9"].CalculatedValue; 

We have modified the sample for your reference and the sample can be downloaded from the following link. 

2. When I close de worksheet saving, the worksheet is not saved 
Also, if I do workbook.save(true) (Close the workbook and save) B2 cell is empty, but if I save with other filename, B2 has SI value 

Currently, we do not have support for workbook.Save() in ASP.NET Core. So, while closing the workbook by passing true (workbook.Close(true)) won’t save the workbook. 

We suggest you to save the document using workbook.SaveAs() method to resolve the issue. 

Regards, 
Keerthi. 


Loader.
Live Chat Icon For mobile
Up arrow icon