my $Excel = Win32::OLE->GetActiveObject('Excel.Application'); unless ($Excel) { $Excel = Win32::OLE->new('Excel.Application'); } my $xls = $Excel->Workbooks->Open(...); my $sheet = $xls->Worksheets(1); #### my $lastrow = $sheet->UsedRange->Find( { What => "*", SearchDirection => xlPrevious, SearchOrder => xlByRows } )->{Row};