Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

OLE IDispatch access with Perl

by Corion (Patriarch)
on Jun 06, 2000 at 17:36 UTC ( [id://16602]=note: print w/replies, xml ) Need Help??


in reply to Stranger in a Strange land

I haven't done it myself, but the Win32::Ole documentation looks quite simple (simple of course, if you know the Excel "object model")...

The MSDN has some documentation on the Excel object model, as has the Office Development Kit, something you might want to buy if you do Office development on a regular basis...

Some code from the top of my head - I haven't done Excel automation for a looong time ... Note that you can take the method and object names from any VB code, as both Perl and VB call through the IDispatch methods of Excel.

$ex = Win32::OLE->new('Excel.Application') or die "oops\n"; $ex->Worksheets(0)->Cells(0,0) = "Hello world";

I'm not sure about the parameters you have to pass to the Cells function - some VB sample code should be easy to port though.

Replies are listed 'Best First'.
RE: OLE IDispatch access with Perl
by Jonathan (Curate) on Jun 06, 2000 at 18:39 UTC
    Thanks for that,

    Simple things do appear fairly straight forward, guess I'll have to bite the bullet and take on the Excel object model.
    A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://16602]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2024-04-24 05:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found