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

Re: Perl-Excel Guidelines

by jsprat (Curate)
on Jul 16, 2003 at 17:16 UTC ( [id://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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-04-16 04:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found