Solved

How to export database file to Excel file?

Posted on 1998-08-04
3
160 Views
Last Modified: 2010-04-04
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?
0
Comment
Question by:Mariner080498
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
ZifNab earned 100 total points
ID: 1359690
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 :

    ExcelApp.Quit;

    To send data to active cell in Excel :

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

    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 }
    http://sunsite.icm.edu.pl/delphi/ftp/d20free/oleexcel.zip 


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

----

About the OLE-thing, this is a good article!
http://members.aol.com/charliecal/ 

       go to OLE automation: Delphi, Word and Excel.

Regards,Zif.





0
 

Author Comment

by:Mariner080498
ID: 1359691
 Thank you ZifNab !
Your answer take a plase.
Have you idea may i use :
 ExcelApp.worksheet(Sheet1).Range(1.1):='  ...  ';
 
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1359692
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)

Zif.
0

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
When I am typing into a TEdit last word repeats 7 178
Print Graphic and Text to Epson TM-T88v 12 556
Reconfigure Delphi Install? 2 77
Dev express lookupcombo 3 64
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question