xvExcel2007: 'Cell is missing/is of wrong type' exception
Posted: Thu Sep 27, 2012 8:04 pm
I get a 'Cell is missing/is of wrong type' exception for any formula I try to use while using xvExcel2007. I'm using delphi 2007. Any reason for this? We have been using the xvExcel97 version with no issue, but it appears some of our clients want the most recent file extension(.xlsx). I thought maybe the formulas might be different, but I'm not sure...Any insight would be most appreciated.
Code: Select all
procedure TForm1.RzButton1Click(Sender: TObject);
begin
xls.filename := 'c:\temp\test.xlsx';
xls.version := xvExcel2007;
xls.Sheet[0].AsFloat[0, 0] := 1;
xls.Sheet[0].AsFloat[0, 1] := 2;
xls.Sheet[0].AsFormula[0, 2] := 'sum(A1+A2)';
// xls.Sheet[0].AsFormula[0, 2] := 'sum(,A1,A2)'; --also tried this.
// xls.Sheet[0].AsFormula[0, 2] := 'A1+A2'; --also tried this.
xls.Write;
end;