Hello!
I try trial version of XLSReadWriteII 4.00.55a in Delphi XE2
Situation :
xls.sheets[0].AsFormula[1,1]:='A1+B1';
Result in excel = =#N/A
thx,
ASD
AsFormula =#N/A error
Re: AsFormula =#N/A error
I have the same problem with the same trial version using D_2010 when trying:
xls.sheets[0].AsFormulaRef['H7'] := 'C7*D7';
Excel version 14.0.4734.1000 (32-bit)
....and still can't find a solution to the previous post about how to set currency formatting:
with XLRW.Sheet[0] do
begin
Range.ItemsRef['A2:J6'].FontStyle := [xfsBold];
Columns.AddIfNone(8,1); //Column 'I'
Columns[8].PixelWidth := 96;
Range.ItemsRef['A2:J6].VertAlignment := cvaCenter;
Range.ItemsRef['C5:I6].HorizAlignment := chaCenter;
AsFormula[8,5] := 'SUM(H6:H7)';
//
// This is where I would like to format Cell[8,5] as currency with 2 decimal places and a symbol, e.g. $87.23
end;
xls.sheets[0].AsFormulaRef['H7'] := 'C7*D7';
Excel version 14.0.4734.1000 (32-bit)
....and still can't find a solution to the previous post about how to set currency formatting:
with XLRW.Sheet[0] do
begin
Range.ItemsRef['A2:J6'].FontStyle := [xfsBold];
Columns.AddIfNone(8,1); //Column 'I'
Columns[8].PixelWidth := 96;
Range.ItemsRef['A2:J6].VertAlignment := cvaCenter;
Range.ItemsRef['C5:I6].HorizAlignment := chaCenter;
AsFormula[8,5] := 'SUM(H6:H7)';
//
// This is where I would like to format Cell[8,5] as currency with 2 decimal places and a symbol, e.g. $87.23
end;
Re: AsFormula =#N/A error
The only way I have found around the problem is the following....
xls.sheets[0].AsFormula[1,1]:='SUM(A1,B1)'; which could also be written as xls.sheets[0].AsFormula[1,1]:='SUM(A1:B1)'; in this case.
or in my case
xls.sheets[0].AsFormulaRef['H7'] := 'PRODUCT(C7:D7)';
But still haven't found a way to format cells as currency.
xls.sheets[0].AsFormula[1,1]:='SUM(A1,B1)'; which could also be written as xls.sheets[0].AsFormula[1,1]:='SUM(A1:B1)'; in this case.
or in my case
xls.sheets[0].AsFormulaRef['H7'] := 'PRODUCT(C7:D7)';
But still haven't found a way to format cells as currency.
Re: AsFormula =#N/A error
Hello
The N/A error is fixed in the latest update.
When formatting numeric values, use the NumberFormat property. Example: XLS.Sheets[0].Cell[0,0].NumberFormat := '# ##0.000';
The format string is the same as in excel.
The N/A error is fixed in the latest update.
When formatting numeric values, use the NumberFormat property. Example: XLS.Sheets[0].Cell[0,0].NumberFormat := '# ##0.000';
The format string is the same as in excel.
Lars Arvidsson, Axolot Data
Re: AsFormula =#N/A error
[quote="larsa"]Hello
The N/A error is fixed in the latest update.
When formatting numeric values, use the NumberFormat property. Example: XLS.Sheets[0].Cell[0,0].NumberFormat := '# ##0.000';
The format string is the same as in excel.[/quote]
thanx, good job
The N/A error is fixed in the latest update.
When formatting numeric values, use the NumberFormat property. Example: XLS.Sheets[0].Cell[0,0].NumberFormat := '# ##0.000';
The format string is the same as in excel.[/quote]
thanx, good job