Esta es la funcion para cargar el Excel
Código Delphi
[-]function TF_GeraGridExcel.GerarGridNoExcel(ADBGrid : TDbgrid): boolean;
var
ExcelExport: TOLEExcel;
i: integer;
s: string;
begin
result := TRUE;
Screen.Cursor := crHourGlass;
ExcelExport := TOLEExcel.Create(Application);
try
ExcelExport.IgnoreFont := false;
ExcelExport.TitleFont.Style := ExcelExport.TitleFont.Style + [fsBold];
ExcelExport.CreateExcelInstance;
ExcelExport.DataSetToExcel(AGridExcel.DataSource.DataSet);
ExcelExport.Visible := True;
finally
FreeAndNil(ExcelExport);
Screen.Cursor := crDefault;
end;
end;