use warnings ; use Storable ; use Cwd; use Win32::OLE ; use Win32::OLE qw(in with) ; my $file = cwd.'\\'."myexcel.xlsm" ; my $Excel = Win32::OLE->new("Excel.Application") ; my $workbook = $Excel->Workbooks->Open($file) ; die "Failed to define Excel workbook" unless (defined $workbook) ; $workbook->Save;