procedure TForm1.Button1Click(Sender: TObject);
var
str:string;
i:Integer;
excelapp,sheet:Variant;
begin
// lbl2.Caption:=DateTimeToStr(Now);
str:='';
dbgrd1.DataSource.DataSet.DisableControls;
for i:=0 to dbgrd1.DataSource.DataSet.FieldCount-1 do
str:=str+dbgrd1.DataSource.DataSet.fields[i].DisplayLabel+char(9);
str:=str+#13;
dbgrd1.DataSource.DataSet.First;
while not(dbgrd1.DataSource.DataSet.eof) do begin
for i:=0 to dbgrd1.DataSource.DataSet.FieldCount-1 do
str:=str+dbgrd1.DataSource.DataSet.Fields[i].AsString+char(9);
str:=str+#13;
dbgrd1.DataSource.DataSet.next;