![]() |
Perl script runs from command prompt but not from Task Scheduler in Win2000
Hi all,
I have a script that runs fine from the command prompt, but that fails when I run it from Task Scheduler. Apparently the line that is failing is an OLE module command: $xlworkbook = $xl_app->Workbooks->Add; Any ideas what might cause this behavior or how to pin down the cause? I'm getting no errors messages of any sort in the Event Viewer. Thanks, Kyle |
Re: Perl script runs from command prompt but not from Task Schedulerin Win2000
kpowell10 wrote:
> I have a script that runs fine from the command prompt, but that fails > when I run it from Task Scheduler. > > Apparently the line that is failing is an OLE module command: > $xlworkbook = $xl_app->Workbooks->Add; > > Any ideas what might cause this behavior or how to pin down the cause? > I'm getting no errors messages of any sort in the Event Viewer. what happens if you wrap it in an eval {} and dump $@ somewhere? Mark |
Re: Perl script runs from command prompt but not from Task Scheduler in Win2000
In article <409bae44$1@news.kcl.ac.uk>,
Mark Clements <mark.clements@kcl.ac.uk> wrote: > kpowell10 wrote: > > > I have a script that runs fine from the command prompt, but that fails > > when I run it from Task Scheduler. > > > > Apparently the line that is failing is an OLE module command: > > $xlworkbook = $xl_app->Workbooks->Add; > > > > Any ideas what might cause this behavior or how to pin down the cause? > > I'm getting no errors messages of any sort in the Event Viewer. > > what happens if you wrap it in an eval {} and dump $@ somewhere? Or put a line like the following at the start of the script: open(STDERR, ">>", "c:/temp/odd_errors") or die("can't change STDERR: $!"); # yes, I see the problem open(STDOUT, ">>", "c:/temp/odd_output") or die("can't change STDOUT: $!"); warn (('-' x 5) . ' ' . scalar(localtime) . "\n"); .... HTH, Ricky -- Pukku |
Re: Perl script runs from command prompt but not from Task Scheduler in Win2000
"Richard Morse" <remorse@partners.org> wrote in message
news:remorse-D63F92.12101007052004@plato.harvard.edu... > Or put a line like the following at the start of the script: > > open(STDERR, ">>", "c:/temp/odd_errors") > or die("can't change STDERR: $!"); # yes, I see the problem > open(STDOUT, ">>", "c:/temp/odd_output") > or die("can't change STDOUT: $!"); or better yet, put it in a BEGIN block to catch compile time info |
Re: Perl script runs from command prompt but not from Task Scheduler in Win2000
Quoth kpowell10@hotmail.com (kpowell10): > Hi all, > > I have a script that runs fine from the command prompt, but that fails > when I run it from Task Scheduler. > > Apparently the line that is failing is an OLE module command: > $xlworkbook = $xl_app->Workbooks->Add; > > Any ideas what might cause this behavior or how to pin down the cause? You probably don't have Excel running when the task is scheduled. IIRC there is an OLE call that will create a new instance of Excel.Application, or return a running one if there is one...? Ben -- If you put all the prophets, | You'd have so much more reason Mystics and saints | Than ever was born In one room together, | Out of all of the conflicts of time. ben@morrow.me.uk The Levellers, 'Believers' |
| All times are GMT. The time now is 02:22 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.