Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Fri Jan 28, 2022 10:37 am

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.
Before Double click C5.PNG
Before Double click C5.PNG (31.92 KiB) Viewed 716 times

But when I open the excel, the formulas have not been recalculated.
I must double click on the cell so that all are recalculated.
After double click.PNG
After double click.PNG (49.38 KiB) Viewed 716 times

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!
Attachments
Files.rar
(273.36 KiB) Downloaded 96 times

LauraNM
 
Posts: 77
Joined: Tue Feb 19, 2019 1:23 pm

Sat Jan 29, 2022 1:34 am

Hello,

Thank you for your inquiry.
I tested your Excel file, but didn't reproduce the issue you mentioned. The version I used is the latest version(Spire.XLS Pack Version:12.1). If you were not using the latest version, please first give it a try. If the issue still exists after trying, please provide the following information for our further investigation. Thanks in advance.
1) Your test environment, such as OS info (E.g. Windows 7, 64-bit) and region setting (E.g. China, Chinese).
2) Your application type, such as Console app (. Net Framework 4.5).

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1647
Joined: Wed Apr 07, 2021 2:50 am

Sun Jan 30, 2022 12:35 pm

Hello,

Before submitting the question I updated to the latest version of the library just in case.
We have tried in windows server 2016, in windows 10 and in windows 7. I have tried in two different types of solutions. With .Net Framework 4.5 and Net Core 2.2.


to reproduce the error:
1.- Open the source file in C#.


string filePath = @"D:\Source.xlsx";
Workbook workbook.LoadFromFile(filePath);


2.- Set the value of cell [5,3] of the first sheet.

It could be, 1", 2" ,3"...6",7"...

Worksheet sheet = workbook.Worksheets[0];
sheet.Range[5,3].Value= @"6""";
sheet.Range[5, 3].Value2 = @"6""";
sheet.Range[5, 3].Text = @"6""";

3.- Recalculate the formulas and save the file with another name.
workbook.CalculateAllValue();
workbook.SaveToFile(@"d:\Result.xlsx", Spire.Xls.FileFormat.Version2010);

This should cause cells [7,3][8,3][9,3][10,3]... on the first sheet to be recalculated.

If you open the generated file (Result.xlsx) you will see that the formulas of the first sheet have NOT been recalculated.
Keep putting #VALUE into de cells [7,3][8,3][9,3][10,3]...
As seen in the first image.

If you double click on cell [5,3] and then click elsewhere to finish editing the cell, you will see that the rest of the formulas are recalculated as seen in the second image.

I need the cells to be recalculated automatically without having to force the calculation manually when opening the file.

If you have doubts about how to reproduce the error, tell me and I will try to be more explicit.

Greetings and thank you very much for your help.

LauraNM
 
Posts: 77
Joined: Tue Feb 19, 2019 1:23 pm

Mon Jan 31, 2022 4:33 am

Hello,

Thanks for your feedback.
I tested your case again and used the MS Excel2010 to view the result Excel file, and reproduced the issue you mentioned. I have logged the issue into our bug tracking system with the ticket number SPIREXLS-3675. Our development team will investigate and fix it. Once it is resolved, I will inform you in time. Sorry for the inconvenience caused.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1647
Joined: Wed Apr 07, 2021 2:50 am

Mon Jan 31, 2022 7:01 am

Thank you very much!

LauraNM
 
Posts: 77
Joined: Tue Feb 19, 2019 1:23 pm

Tue Feb 08, 2022 10:07 am

Hello!
Have you been able to see this error? I have a pending delivery and I need at least a delivery date to tell the customer.

Thanks a lot!

LauraNM
 
Posts: 77
Joined: Tue Feb 19, 2019 1:23 pm

Wed Feb 09, 2022 3:57 am

Hello,

Thanks for your follow-up.
I'm sorry that the issue SPIREXLS-3675 is under investigation and no implementation time has been set yet. I've asked our developers to estimate the implementation time as soon as possible. I will keep you informed of any updates.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1647
Joined: Wed Apr 07, 2021 2:50 am

Wed Feb 09, 2022 6:46 am

Thank you very much!

LauraNM
 
Posts: 77
Joined: Tue Feb 19, 2019 1:23 pm

Mon Feb 21, 2022 8:48 am

Hello!
Is there any progress on this topic?

Thank you very much!

LauraNM
 
Posts: 77
Joined: Tue Feb 19, 2019 1:23 pm

Mon Feb 21, 2022 9:32 am

Hello,

You're welcome!
Good news is that the issue SPIREXLS-3675 has been solved. Once the new version is available, I will inform you immediately.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1647
Joined: Wed Apr 07, 2021 2:50 am

Mon Feb 21, 2022 9:57 am

Thank you very much! :D

LauraNM
 
Posts: 77
Joined: Tue Feb 19, 2019 1:23 pm

Mon Mar 07, 2022 6:49 am

Hello!
Is there any progress on this issue? Any estimated publication date?

Thank you very much!

LauraNM
 
Posts: 77
Joined: Tue Feb 19, 2019 1:23 pm

Mon Mar 07, 2022 10:03 am

Hello,

Thanks for following up.
The issue SPIREXLS-3675 has been fixed perfectly, and we will provide you with a provisional version tomorrow. Thanks for your understanding.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1647
Joined: Wed Apr 07, 2021 2:50 am

Mon Mar 07, 2022 10:28 am

Thank you very much!

LauraNM
 
Posts: 77
Joined: Tue Feb 19, 2019 1:23 pm

Tue Mar 08, 2022 6:21 am

Hello,

Thanks for your patience.
We have compiled a temporary version(spire.office_7.3.0) for you. I have confirmed your issue has been resolved in this version. Please download and test with it.
Besides, I will inform you ASAP when the official version is released.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1647
Joined: Wed Apr 07, 2021 2:50 am

Return to Spire.XLS