Transferir dados para o Excel

Delphi

01/04/2004

Olá Pessoal!


Quero transferir para uma planilha no excel dados de uma pesquisa contidos num dbgrid e salva-la. Como fazer?

Grato

Francisco


Lunaf

Lunaf

Curtidas 0

Respostas

Thematrix:reloaded

Thematrix:reloaded

01/04/2004

http://www.clubedelphi.com.br/exemplos/index.html


GOSTEI 0
Lucas Silva

Lucas Silva

01/04/2004

uses ComObj;
.
.
.
procedure TForm1.Button1Click(Sender: TObject);
var excel: variant;
begin

      excel := CreateOleObject(´Excel.Application´);
      excel.Workbooks.add(1);
      excel.Cells.Select;
      excel.Selection.NumberFormat := ´@´;


      excel.cells[1,1] := ´Teste´;
      excel.columns.AutoFit;
      excel.cells[1,1].Select;
      excel.visible := true;

end;



GOSTEI 0
Dorivansousa

Dorivansousa

01/04/2004

tente este componente
http://www.activedelphi.com.br/componentes/Exceldb.zip

ou este artigo...
http://paginas.cfjl.com.br/~fabricio/sistemas/delphi/artigos/gerar.htm


GOSTEI 0
POSTAR