use strict; use Win32::OLE qw(in with); use Win32::OLE::Const 'Microsoft Excel'; $Win32::OLE::Warn = 3; # Die on Errors. ####################################### ## ::Warn = 2 throws the errors, but ## ## expects that the programmer deals ## ####################################### my $excelfile = 'c:\temp\win32\tabexample.xls'; my $excelout = 'c:\temp\win32\tabexample.tab'; my $Excel = Win32::OLE->GetActiveObject('Excel.Application') || Win32::OLE->new('Excel.Application', 'Quit'); $Excel->{DisplayAlerts}=0; my $Book = $Excel->Workbooks->Open($excelfile); $Book->SaveAs({Filename =>$excelout, FileFormat => xlCurrentPlatformText}); #### my $sheetcnt = $Book->Worksheets->Count(); foreach (2..$sheetcnt){ print $Book->Worksheets($_)->{Name} ."\n"; my $sheet = $Book->Worksheets($_); ##Do something with the sheet object## }