Jump to content
Fórum Script Brasil
  • 0

(Resolvido) Exportar dados para o excel


nicolasbraz
 Share

Question

Tenho uma tabela em Excel com vários registros e queria exportar ela para uma tabela do meu banco de dados tentei o comando insertex pelo ibexpert mas eu tive vários problemas com ele.

Existe alguma outra forma de fazer essa exportação?

Edited by nicolasbraz
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

exemplo: exportar dados do stringgrid para o excel

uses ComObj;

procedure TForm1.Button1Click(Sender: TObject);
var excel: variant;
    lin,col : integer;
begin

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

      for lin := 1 to StringGrid1.RowCount  do
         for col := 1 to StringGrid1.ColCount do
            begin
               excel.cells[lin,col] := StringGrid1.cells[lin,col];
               excel.columns.AutoFit;
               excel.cells[lin,col].Select;
            end;
      excel.visible := true;
end;

outros exemplos:

http://scriptbrasil.com.br/forum/index.php?showtopic=90117

http://www.planetadelphi.com.br/dica/5329/...do-para-o-excel

http://www.planetadelphi.com.br/dica/7014/...hi%20p/%20excel

abraço

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Forum Statistics

    • Total Topics
      150.9k
    • Total Posts
      648.7k
×
×
  • Create New...