Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

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.


Comment on OLE IDispatch access with Perl
Download Code
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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2014-12-29 10:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (186 votes), past polls