Excel:=CreateOleObject('Excel.Application');
Excel.Visible := False;
Excel.DisplayAlerts:= False;
Excel.WorkBooks.Add;
Excel.WorkBooks[1].WorkSheets[1].Name := 'Libro';
Libro := Excel.WorkBooks[1].WorkSheets['Libro'];
Libro.Cells[1,1]:='Reporte';
Libro.Cells[4,1].Font.Bold:=True;
Libro.Columns.Columns[2].ColumnWidth := 50;
with UnQuery do begin
first;
Libro.Cells[i,1]:=FieldByname('UnCampo').AsString;
Libro.Cells[i,1].Font.Bold:=True;
while not EOF Do begin
Libro.Cells[i,1]:=FieldByName('OtroCampo').AsString;
.....
Next;
end; end;