Problem executing calculate method two times.

Questions and answers on how to use XLSReadWriteII 5.

Problem executing calculate method two times.

Postby aristeo » Tue Feb 06, 2018 8:24 pm

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: 6
Joined: Sun Sep 17, 2017 8:47 pm

Re: Problem executing calculate method two times.

Postby aristeo » Tue Feb 06, 2018 8:54 pm

Could be a solution reset all formulas before executing Calculate the second time?
If yes, is thete any way to reset all formulas?
aristeo
 
Posts: 6
Joined: Sun Sep 17, 2017 8:47 pm

Re: Problem executing calculate method two times.

Postby larsa » Wed Feb 07, 2018 11:12 am

Hello

I can't reproduce this. What is the formulas that you are using?
Lars Arvidsson, Axolot Data
larsa
Site Admin
 
Posts: 640
Joined: Mon Jun 27, 2005 9:30 pm

Re: Problem executing calculate method two times.

Postby aristeo » Wed Feb 07, 2018 12:15 pm

The issue occurs with XLS files. And the formula stored in C2 is "=B2"
aristeo
 
Posts: 6
Joined: Sun Sep 17, 2017 8:47 pm

Re: Problem executing calculate method two times.

Postby larsa » Tue Feb 13, 2018 11:58 am

Hello

Still no luck reproducing this.
Lars Arvidsson, Axolot Data
larsa
Site Admin
 
Posts: 640
Joined: Mon Jun 27, 2005 9:30 pm


Return to XLSReadWritwII 6

Who is online

Users browsing this forum: No registered users and 1 guest