Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Win32::OLE excel

by jsprat (Curate)
on May 30, 2003 at 17:48 UTC ( #261905=note: print w/replies, xml ) Need Help??


in reply to Win32::OLE excel

I'm not 100% sure what you're asking. It sounds like you want the size of the UsedRange? If so, have a look at the Count property of the Rows and Columns collections of the UsedRange object (How's that for an awkward sentence).

It should look something like this:

use strict; use Win32::OLE; my $ole = Win32::OLE->new('Excel.Application', 'Quit') or die "$!"; $ole->{Visible} = 1; my $xls = $ole->{Workbooks}->Open('mr.xls'); my $sheet = $xls->{Sheets}->{Template}; print $sheet->{UsedRange}->{Rows}->{Count}, " rows, ", $sheet->{UsedRange}->{Columns}->{Count}, " columns used."; __END__ Output: C:\>perl xls.pl 40 rows, 11 columns used.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://261905]
help
Chatterbox?
[Corion]: "zero monetary cost", because of course, it's gratis only if your time has no value :)
[marto]: I used to keep up to date with my android ROMs, updating to the nightly every other day
[marto]: in my experience the jump in major releases has been painless, and performed better
[marto]: Corion if your device has an official Oreo ROM I'd do a nandroid backup and give it a shot

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2017-12-14 10:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (389 votes). Check out past polls.

    Notices?