tab.First; while not tab.Eof do begin for r := 1 to tab.FieldCount do begin if tab.Fields[r-1].DataType=ftString then XlSheet.Cells.Item[x,r].Value:=''+tab.Fields[r-1].AsString else XlSheet.Cells.Item[x,r].Value:=tab.Fields[r-1].AsString end; tab.Next; inc(x,1); end;