Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

OLE IDispatch access with Perl

by Corion (Pope)
on Jun 06, 2000 at 17:36 UTC ( #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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://16602]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2017-12-15 20:46 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (443 votes). Check out past polls.