Thanks. F: is the local drive on the server. Now I schedule the script to be run on a daily base instead of calling from my local machine. So far it is OK.
Thanks anyway. Cheers, Jason > Date: Wed, 3 Oct 2012 19:34:45 +0200 > Subject: Re: Perl script on a server using Win32::OLE > From: natxo.ase...@gmail.com > To: beginners@perl.org > > On Wed, Sep 26, 2012 at 8:23 AM, Jason Feng <q15...@hotmail.com> wrote: > > > > Hello, > > > > I have a Perl script running on a Windows 2008 server which uses Win32::OLE > > to dump the results on Excel files. It is working fine when I remote login > > to the server and run the script. > > > > Now I want to write a Perl script on my local machine using Net::Telnet to > > remote run the script on the server. The script on the server can be called > > and run successfully until it attempts to open an Excel file. The error is > > shown as the following. > > > > =========================== > > OLE exception from "Microsoft Excel": > > > > Microsoft Excel cannot access the file > > 'F:\Apps\Delta_rpt\xxxx_template.xlsx'. There are several possible > > reasons: > > > > • The file name or path does not exist. > > • The file is being used by another program. > > • The workbook you are trying to save has the same name as a currently open > > workbook. > > > > Win32::OLE(0.1709) error 0x800a03ec > > in METHOD/PROPERTYGET "Open" at F:\Apps\Delta_rpt\pm_delta.pl line 320 > > =========================== > > > > There is no such error if I use remote desktop to the server and run the > > script. I am wondering if Win32::OLE does not support the remote call? > > is this F: drive a network mapping or a fixed disk? > > If it is a network drive, then it is very likely that when calling > this code from a remote host with Net::Telnet (you are aware this is > very insecure, of course) then the mapping is not there. That would > explain the error. > > -- > groet, > natxo > > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.org > http://learn.perl.org/ > >