Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Found this, maybe it will help someone:
######################################
use Win32::OLE;
use Win32::OLE::Const 'Microsoft Excel';
use strict;
my $xl = Win32::OLE->GetActiveObject('Excel.Application') ||
Win32::OLE->new('Excel.Application');
die "Cannot start Excel" unless $xl;
my $workbook=$xl-> Workbooks->Open('C:\\temp\\book1.xls');
my $worksheet=$workbook->Worksheets('Sheet1');
my $LastRow = $worksheet->UsedRange->Find({What=>"*",
SearchDirection=>xlPrevious,
SearchOrder=>xlByRows})->{Row};
my $LastCol = $worksheet->UsedRange->Find({What=>"*",
SearchDirection=>xlPrevious,
SearchOrder=>xlByColumns})->{Column};
print "Number of used rows: $LastRow\n";
print "Number of used cols: $LastCol\n";
my $lnRow=1;
my $lnCol=1;
while ($lnRow <= $LastRow) {
$lnCol = 1 if ($lnCol > $LastCol);
my $notes = $worksheet->Cells($lnRow,$lnCol)->{NoteText};
print $notes,"\n" if ($notes);
$lnRow++ if $lnCol == 1;
$lnCol++;
}
$xl->Quit;
__END__
###############################
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question