#!/usr/bin/perl use strict; use warnings FATAL => qw( all ) ; use Win32::OLE; use Win32::OLE::Variant; use Win32::OLE::Const 'Microsoft Excel'; our $Excel = undef ; my $file = 'template_001.xlsx' ; $Excel = Win32::OLE->GetActiveObject('Excel.Application') || Win32::OLE->new('Excel.Application'); $Excel->{DisplayAlerts}=0; #0 is hide alerts # Open File and Worksheet my $Book = $Excel->Workbooks->Open($file) or die "Can't open workbook\n" ; print ("The excel book is $Book\n") ; #### my $file = 'c:\path\subpath\template_001.xlsx' ;