for $byDate(@dateSort) { @lines=split/_/,$byDate; # #Read file names in order to retrieve latest revision #date from Excel sheets # $name=join "_", @lines[1,2,3,4]; # # Open the excel file # $fileName = $current_dir.'\\'.$name; if ($output ne '') { print STDOUT "Opening $name"; } $wkb = $xapp->Workbooks->Open($fileName); if ( ! $wkb ) { print STDOUT "\n\nCan't open $name. File name format incompattible.\n"; exit; } #Open correct sheet from wkbk my $wks = $wkb->Worksheets(1); #Find the latest revision date from the sheet $lastUpdate = $wks->Cells(8,B)->{'Value'}; $wkb->{Saved} = 1; $wkb->Close(); $xapp->Quit();