Page 1 of 1

Problem executing calculate method two times.

Posted: Tue Feb 06, 2018 8:24 pm
by aristeo
If I execute a code like this:

Code: Select all

  with TXLSReadWriteII5.Create(nil) do
    try
      LoadFromFile('c:\tmp.xls');
      Sheet[0].AsFloat[1,1]:=12;
      Calculate;
      //Shows the C2 formula content, and is a correct value
      ShowMessage(FloatToStr(Sheet[0].AsFloatRef['C2']));
      Calculate;
      //Shows the C2 formula content, and is not correct. The value is 0
     ShowMessage(FloatToStr(Sheet[0].AsFloatRef['C2']));      
    finally
      Free;
    Free;
Obviuously, this is a very simple sample of a tool of my project. But the problem is that whe I try execute Calculate morte than one time, the formula values gets 0. Somebody knows what's the problem? is it a bug? Thank you

Re: Problem executing calculate method two times.

Posted: Tue Feb 06, 2018 8:54 pm
by aristeo
Could be a solution reset all formulas before executing Calculate the second time?
If yes, is thete any way to reset all formulas?

Re: Problem executing calculate method two times.

Posted: Wed Feb 07, 2018 11:12 am
by larsa
Hello

I can't reproduce this. What is the formulas that you are using?

Re: Problem executing calculate method two times.

Posted: Wed Feb 07, 2018 12:15 pm
by aristeo
The issue occurs with XLS files. And the formula stored in C2 is "=B2"

Re: Problem executing calculate method two times.

Posted: Tue Feb 13, 2018 11:58 am
by larsa
Hello

Still no luck reproducing this.