# get already active Excel application or open new my $Excel = Win32::OLE->GetActiveObject('Excel.Application') || Win32::OLE->new('Excel.Application', 'Quit'); # open Excel file #my $dir = "E:\\Automation Related\\Perl Scripts - ALL\\IMS_debugging\\Excel\\"; my $excelfile = 'UE_NW_Parameters.xlsx'; #my $Book = $Excel->Workbooks->Open($dir.$excelfile) my $Book = $Excel->Workbooks->Open($excelfile) or die Win32::OLE->LastError();