Good morning,
I am trying to fill in the data from an excel and have the formulas recalculated.
In this particular case I must fill the cell Sheet1!C5.
The value is correctly put into the cell.
But when I open the excel, the formulas have not been recalculated.
I must double click on the cell so that all are recalculated.
How can i fix this?
I pass you my code:
string filePath = @"D:\Source.xlsx";
Workbook workbook.LoadFromFile(filePath);
//INamedRange cell = workbook.NameRanges.GetByName("Size");
//cell.RefersToRange.Cells[0].Value = @"6""";
//cell.RefersToRange.Cells[0].Value2 = @"6""";
//cell.RefersToRange.Cells[0].Text = @"6""";
Worksheet sheet = workbook.Worksheets[0];
sheet.Range[5,3].Value= @"6""";
sheet.Range[5, 3].Value2 = @"6""";
sheet.Range[5, 3].Text = @"6""";
workbook.CalculateAllValue();
workbook.SaveToFile(@"d:\Result.xlsx", Spire.Xls.FileFormat.Version2010);
Thank you very much!