use strict; use warnings; #use Storable; #use Cwd; use Win32::OLE; #use Win32::OLE qw(in with); #my $file = cwd.'\\'."myexcel.xlsm"; my $file = 'X:\Data\Perl\1131763\example.xls'; my $Excel = Win32::OLE->new("Excel.Application"); $Excel->{Visible} = 1; my $workbook = $Excel->Workbooks->Open($file); die "Failed to define Excel workbook" unless (defined $workbook); system("attrib -r $file"); $Excel->{DisplayAlerts} = 0; $workbook->Save;