#!/usr/bin/perl use strict; use warnings; use Win32::OLE; use Win32::OLE::Const 'Microsoft Excel'; my $xl = Win32::OLE->GetActiveObject('Excel.Application') || Win32::OLE->new('Excel.Application', 'Quit'); $xl->{'Visible'} = 0; $xl->{'DisplayAlerts'} = 0; my $book = $xl->Workbooks->Open('c:\test.xls'); my $sheet = $book->Worksheets(1); my $last_row = $sheet->UsedRange->Find( { What => "*", SearchDirection => xlPrevious, SearchOrder => xlByRows } )->{Row}; print "Start Speed Test..\n"; my $current_time = time; my $time_start = $current_time; foreach my $y (1..$last_row) { foreach my $x ('a'..'j') { my $bla = $sheet->Range($x.$y)->{Value}; } if ((time - $current_time) >= 1) { $current_time = time; my $speed = sprintf("%.2f", ($y / ($current_time - $time_start))); print "$speed Zeilen pro Sekunde\n" unless (($current_time - $time_start) == 0); } } $xl->Workbooks->Quit(); $xl->destroy();