ActiveSheet.Cells.CurrentRegion.Rows is a range bounded by any 
combination of blank rows and blank columns.  So 
ActiveSheet.Cells.CurrentRegion.Rows.Count gives the number of rows.

For example:

#!perl -w
use strict;
use OLE;

my $file="c:/book1.xls";

my $excel = CreateObject OLE 'Excel.Application' || die $!;
$excel->Workbooks->Open($file) or print "Cannot open: $file\n";

print $excel->ActiveSheet->Cells->CurrentRegion->Rows->Count;

$excel->Close();
$excel->Quit();

-- 
   Simon Oliver

_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web

Reply via email to