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

I am getting the below error

What is the error ?

If you add print $Excel->{DefaultFilePath}."\n"; then you will see it is probably set to C:\Users\username\Documents.

Try adding

use Cwd; my $dir = cwd()."/"; $dir =~ s(/){\\}g;

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

Replies are listed 'Best First'.
Re^2: Getting an exception while reading excel file using Win::OLE from a current directory
by rockyurock (Acolyte) on Feb 28, 2017 at 10:38 UTC
    Yup! It;s working now! I was Incorrect path and not using $dir =~ s(/){\\}g; thank you!