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 = 'somefile.csv'; ################################################################### ## First, we need an excel object to work with, so if there isn't## ## an open one, we create a new one, and we define how the object## ## is going to exit ## ################################################################### my $Excel = Win32::OLE->GetActiveObject('Excel.Application') || Win32::OLE->new('Excel.Application', 'Quit'); my $Book = $Excel->Workbooks->Open($excelfile); #### my $Book = $Excel->Workbooks->Add();