Page 1 of 1

xvExcel2007: 'Cell is missing/is of wrong type' exception

Posted: Thu Sep 27, 2012 8:04 pm
by maseline_98
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;

Re: xvExcel2007: 'Cell is missing/is of wrong type' exception

Posted: Fri Sep 28, 2012 11:13 am
by larsa
Hello

I can't reproduce this. The error message "Cell is missing/is of wrong type" make no sense as this only occure when you read a cell value, like AsBoolean and the cell is not a boolean cell.

Re: xvExcel2007: 'Cell is missing/is of wrong type' exception

Posted: Fri Sep 28, 2012 1:10 pm
by maseline_98
My version is:
4.00.05

The only thing I can think of is maybe my version is somehow corrupted or I have an older version. I also had another programmer(he has the same version as I) try to compile and run it and he is getting the same result.

Re: xvExcel2007: 'Cell is missing/is of wrong type' exception

Posted: Fri Sep 28, 2012 1:25 pm
by maseline_98
Here is my call stack:

Code: Select all

FormulaHandler4.TFormulaHandler.GetAsFormulaEx12(???,0,2)
SheetData4.TSheet.GetAsFormulaEx12(???,???)
XLSWriteXML4.WriteFormula
XLSWriteXML4.WriteSheet(0)
XLSWriteXML4.TXLSWrite2007XML.WriteSheets($20A57F0)
XLSWriteXML4.TXLSWrite2007XML.SaveToStream($20A5450,???)
XLSReadWriteII4.TXLSReadWriteII4.WriteToStreamXML($20A5450)
XLSReadWriteII4.TXLSReadWriteII4.Write
Unit1.TForm1.RzButton1Click(???)