Problem executing calculate method two times.

Questions and answers on how to use XLSReadWriteII 5.
Post Reply
aristeo
Posts: 9
Joined: Sun Sep 17, 2017 8:47 pm

Problem executing calculate method two times.

Post 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
aristeo
Posts: 9
Joined: Sun Sep 17, 2017 8:47 pm

Re: Problem executing calculate method two times.

Post 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?
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: Problem executing calculate method two times.

Post by larsa »

Hello

I can't reproduce this. What is the formulas that you are using?
Lars Arvidsson, Axolot Data
aristeo
Posts: 9
Joined: Sun Sep 17, 2017 8:47 pm

Re: Problem executing calculate method two times.

Post by aristeo »

The issue occurs with XLS files. And the formula stored in C2 is "=B2"
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: Problem executing calculate method two times.

Post by larsa »

Hello

Still no luck reproducing this.
Lars Arvidsson, Axolot Data
Post Reply