#!/usr/bin/perl -w use strict; use Win32::OLE qw(in with); use Win32::OLE::Const 'Microsoft Excel'; use Win32::OLE::Variant; $Win32::OLE::Warn = 3; # die on errors... my $Excel = Win32::OLE->GetActiveObject('Excel.Application') || Win32::OLE->new('Excel.Application', 'Quit'); # get already active Excel or create new one as appropriate $Excel->{'Visible'} = 1; # see what's going on if you want my $Book = $Excel->Workbooks->Open('C:\somefile.xlsx'); # open Excel file -- requires explicit DOS path my $Sheet = $Book->Worksheets('Sheet1'); # tab name or sheet number (from 1) my $lastrow = $Sheet->UsedRange->Find({What=>"*",SearchDirection=>xlPrevious,SearchOrder=>xlByRows})->{Row}; for my $row (1..$lastrow) { foreach my $col (qw(A B C D E)) { print $Sheet->Range("$col$row")->{'Value'},"\t"; # range is column letter, row number; can also be the target of an assignment } print "\n"; } $Book->close;