• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 166
  • Last Modified:

How to export database file to Excel file?

How to convert an interbase table to an Excel *.xls file?
May be with OLE component?
If it is right way , witch function of Excel VB must I use?
  • 2
1 Solution
Hi Mariner,

This question is already answered:

       http://www.experts-exchange.com/topics/comp/lang/delphi/Q.10045961 (RONIT)
http://www.experts-exchange.com/Q.10066235 (ZIFNAB)

this is a snippet out of Q.10066235

     we could use OLE to transfer the data to Excel. (Or the older method DDE, but I prefer OLE, b'cose it's the newer method).

    Starting OLE communication is just one line, transferring data is as easy as a snip...

    Then we could iterate throught the result query and just transfer everything to Excel.

    Well, I can give you some more information about this :

    ExcelApp: Variant;

    To open Ole connection :

    ExcelApp:= CreateOleObject('Excel.Application');
    ExcelApp.Visible := True;

    To Close OLE connection :


    To send data to active cell in Excel :

      ExcelApp.ActiveCell := 1; {active cell is filled with number 1}
      on E:EOleSysError do begin
       showmessage('OLESysError '+E.Message+IntToStr(E.ErrorCode));
       else showmessage('unknown error, please report : ');

    BUT I advise you to also look at these fine components which already do your stuff and have some extra features. If you need more advise or want to
    make your own component, just say it and we'll help you.

    BUT look at them first! They are really learnfull!

    { export table, query, stringgrid to excel }

    { export query to word, excel }
    which needs http://sunsite.icm.edu.pl/delphi/ftp/free/excel.zip 


About the OLE-thing, this is a good article!

       go to OLE automation: Delphi, Word and Excel.


Mariner080498Author Commented:
 Thank you ZifNab !
Your answer take a plase.
Have you idea may i use :
¬†ExcelApp.worksheet(Sheet1).Range(1.1):='  ...  ';
Hi Mariner,

What do you want to accomplish?

 I mostly use range as  ...Range['A1:B5']

 anyhow, you can do a lot, I mostly find them out, just by trying them out and looking at the libraries (see article)

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now