in reply to Re^3: 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

I tried to add updated_ in front of sheet path below but it does not allow . $Book->SaveAs('updated_'.$dir."\\".$excelfile);
  • Comment on Re^4: Getting an exception while reading excel file using Win::OLE from a current directory

Replies are listed 'Best First'.
Re^5: Getting an exception while reading excel file using Win::OLE from a current directory
by Corion (Patriarch) on Feb 28, 2017 at 10:10 UTC

    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.

        It;s asking me to overwrite the existing excel file rather creating a new excel file as mentioned in the script .. updated_Excelfile.
Re^5: Getting an exception while reading excel file using Win::OLE from a current directory
by rockyurock (Acolyte) on Feb 28, 2017 at 10:10 UTC
    Actually I want to use the same current directory so I did not specify path of the directory like E:\\ etc