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

Re: Perl-Excel Guidelines

by jsprat (Curate)
on Jul 16, 2003 at 17:16 UTC ( #274943=note: print w/ replies, xml ) Need Help??


in reply to Perl-Excel Guidelines

Here at perlmonks:

MSDN:
  • Excel object model (you may need to poke around for your specific version of excel, but overall it hasn't evolved much that I've seen)
On your local hard drive:
  • OLE-Browser - installed with perl, look in the ActiveState menu (if you're running ActiveState perl)
  • Open Excel, hit Alt-F11 to open VBA environment, then hit F2 to view the Object Browser
  • The Excel VB help file has the object model in detail. This helpfile is not installed by default, so you may need to rerun setup.
You'll also need curly brackets around properties, and method calls look the same as they do in straight perl:

VBPerl
Properties:Selection.Hidden = True $xls->Selection->{Hidden} = 1;
Methods:Worksheets(1).Activate $xls->Worksheets(1)->Activate;

A couple of things about Win32::OLE you may find helpful:

  • Win32::OLE->Option( Warn => 3 ); # or 2 or 4
  • # load all excel constants (I may have the library name wrong) use Win32::OLE::Const 'Microsoft Excel';
  • # make it a little easier to iterate over collections use Win32::OLE qw/IN WITH/;

Update: Closed the list tag, added missing tr.


Comment on Re: Perl-Excel Guidelines
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (9)
As of 2014-12-22 15:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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





    Results (120 votes), past polls