formula with external file reference

Questions and answers on how to use XLSReadWriteII 3/4/5.

formula with external file reference

Postby mlauter » Thu Apr 24, 2008 4:35 am

Hi,

I have 2 workbooks, FRefBook and FWorkbook. I want to copy a formula from the FRefBook instance. The formula is:
[demo.xls]Sheet1!C1

I get errors trying to write the external reference to the new workbook.
two questions:
1. Is there any way to read a formula with an external file reference?
2. Is there any way to write a formula with an external file reference?

Here is some sample code in Delphi.

Code: Select all
         vFormula := FRefBook.Sheets[0].AsFormula[0, 0];
         // vFormula should be exactly '[demo.xls]Sheet1'!C1
         // but vFormula as read from FRefBook is demo.xlsSheet1!C1 and that is totaly incorrect
         if vFormula <> '' then begin
            // raises exception - error in formula demo.xlsSheet1!C1
            FWorkbook.Sheets[0].AsFormula[2, 8] := vFormula;

            // fix formula to exactly what is in working spreadsheet
            vFormula := '''[demo.xls]Sheet1!''C1';
            // raises exception - error in formula illegal character
            FWorkbook.Sheets[0].AsFormula[2, 8] := vFormula;

            // try a different formual without quotes
            vFormula := '[demo.xls]Sheet1!C1';
            // raises exception - eConvertError demo.xls is not a valid floating point value
            FWorkbook.Sheets[0].AsFormula[2, 8] := vFormula;
         end;


Thanks very much. :D
--
Mark
mlauter
 
Posts: 1
Joined: Thu Apr 24, 2008 4:07 am

Postby larsa » Mon May 05, 2008 7:39 am

Hello

There seems to be a bug here. We will fix this.


Lars Arvidsson, Axolot Data
larsa
Site Admin
 
Posts: 615
Joined: Mon Jun 27, 2005 9:30 pm

Re: formula with external file reference

Postby Moisha » Fri Jul 14, 2017 10:06 am

Is this issue fixed?
I'he got XLSReadWriteII 5 v5.20.85 and the same problem.
Moisha
 
Posts: 9
Joined: Wed Apr 06, 2016 1:00 pm

Re: formula with external file reference

Postby larsa » Tue Jul 18, 2017 7:59 pm

Hello

Please test this with version 6 (you can download a demo from our site). We will only update the current version.
Lars Arvidsson, Axolot Data
larsa
Site Admin
 
Posts: 615
Joined: Mon Jun 27, 2005 9:30 pm


Return to XLSReadWriteII 3/4/5

Who is online

Users browsing this forum: No registered users and 1 guest

cron