#!perl use strict; use warnings; use Win32::OLE; use Cwd; $Win32::OLE::Warn = 3; # get already active Excel application or open new my $Excel = Win32::OLE->GetActiveObject('Excel.Application') || Win32::OLE->new('Excel.Application', 'Quit'); my $dir = getcwd(); my $excelfile = 'Parameters.xlsx'; my $Book = $Excel->Workbooks->Open($dir."\\".$excelfile) or die Win32::OLE->LastError(); # do work $dir =~ s!/!\\!g; $Book->SaveAs($dir."\\".'updated_'.$excelfile); $Book->Close;