Only post a SSCCE. The problem is that OLE::Win32 will not save to a path with forward slashes so you need to convert / to \\ as I showed here.
poj#!perl use strict; use warnings; use Win32::OLE; use Cwd; $Win32::OLE::Warn = 3; # get already active Excel application or open new my $Excel = Win32::OLE->GetActiveObject('Excel.Application') || Win32::OLE->new('Excel.Application', 'Quit'); my $dir = getcwd(); my $excelfile = 'Parameters.xlsx'; my $Book = $Excel->Workbooks->Open($dir."\\".$excelfile) or die Win32::OLE->LastError(); # do work $dir =~ s!/!\\!g; $Book->SaveAs($dir."\\".'updated_'.$excelfile); $Book->Close;
In reply to Re^3: Getting an exception while reading excel file using Win::OLE from a current directory
by poj
in thread Getting an exception while reading excel file using Win::OLE from a current directory
by rockyurock
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |