Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://274943]
help
Chatterbox?
[Corion]: Michael_W: $Variables[0] = $Map_Request_Date; $Variables[1] = $Map_Due_Date; ...
[choroba]: ( $Map_Request_Date, $Map_Due_Date,$Map _Cutover_Date,$Map _Complete_Date,$Ma p_Approved_Date) = @Variables;?
[thezip]: something like: $Map_Request = <value>; etc. should work
[Corion]: Duh - I read it backwards. I shouldn't code today I guess ;)
[thezip]: G'day all, BTW!

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (15)
As of 2017-04-27 15:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (509 votes). Check out past polls.