in reply to Re^4: Getting an exception while reading excel file using Win::OLE from a current directory
in thread Getting an exception while reading excel file using Win::OLE from a current directory

Did you print out the directory name you are trying to save to?

my $outdir = 'updated_'.$dir; my $outfile = $outdir."\\".$excelfile; print "Trying to save to directory [$outdir]\n"; print "Trying to save to file [$outfile]\n"; $Book->SaveAs($outfile);

The directory name you construct makes no sense. Print it out, look at it, and then construct it in a sensible way.

  • Comment on Re^5: Getting an exception while reading excel file using Win::OLE from a current directory
  • Download Code

Replies are listed 'Best First'.
Re^6: Getting an exception while reading excel file using Win::OLE from a current directory
by rockyurock (Acolyte) on Feb 28, 2017 at 10:15 UTC
      It;s asking me to overwrite the existing excel file rather creating a new excel file as mentioned in the script .. updated_Excelfile.

        Seriously, please read your debugging output.

        On Windows, updated E:\ is not a valid directoryname or filename.

        All other errors are simply consequents of that initial error.