Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 513
  • Last Modified:

Delphi 3 commands to Excel 97 (via Ole)

I have a serious question on my mind, and I hope somebody can help me with this.
I know how to communicate with Word 97 from within my Delphi projects, i.e. opening an Olé-object to WordBasic and issue some WordBasic commands from there.

Now, I want to be able to do the same thing with EXCEL.
The only thing is, WICH Olé-object do I need to open and WICH commands are to my disposal once the connection is made ????

Can some-one help me with this ????

With many thanks in advance,
and kind greetings from Belgium

TTYL,

Eddy Praet

E-mail: eddy.praet@advalvas.be

0
epraet
Asked:
epraet
  • 2
  • 2
1 Solution
 
ZifNabCommented:
Dag Eddy,

Beste groeten uit België.

Wat is TTYL? Als ik vragen mag...

Ok, we'll talk in English, so everybody can follow this thread :

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

 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;


It's as simple as in Word...

A good article is this one :

http://members.aol.com/charliecal/ 

go to OLE automation: Delphi, Word and Excel.

-----> READ THIS ARTICLE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

--> very good explenation on how to get the commands you can use by OLE.

further, i advice to look at some components there are some good ones with learnfull code.

Regards, Zif.

If you need more, just ask!

Nog een goeie avond verder en tot morgen?

Finally some Dutch in expert-exchange!!

0
 
epraetAuthor Commented:
Hartelijk dank voor je responce ! :-)

E-Mail me at: eddy.praet@advalvas.be

Groetjes uit Wilrijk

Eddy

PS: TTYL = Talk To You Later... :-)

0
 
epraetAuthor Commented:
Hartelijk dank voor je responce ! :-)

E-Mail me at: eddy.praet@advalvas.be

Groetjes uit Wilrijk

Eddy

PS: TTYL = Talk To You Later... :-)

0
 
ZifNabCommented:
Graag gedaan. TTYL. :-) Zif.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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