#117157 - 2004-04-01 02:20 AM
Problem Openning Excel File
|
bleonard
Seasoned Scripter
   
Registered: 2001-01-19
Posts: 581
Loc: Chicago, IL
|
Greetings to the Board! It's been a while since I last posted - so long I did not recognize the new layout! Looks great, and good to see the 'old timers' now as moderators.
I've got what I think is a simple question for some of you. I'm trying to open an Excel worksheet with KiX and a Scheduled Task. But, I get a failure when running the open command (Error 6, invalid file handle). But, when I run script with same user id from command line it runs fine! I snagged my code from a long-time existing script that works fine, so I am thinking problem is not KiX. Any assistance would be appreciated. Code is: Code:
$FilXls = "nobill.xls" $DirScr = @SCRIPTDIR $XlsCur = $DirScr + "\" + $FilXls $oXL = CreateObject("Excel.application") $xlOpen = $oXL.Workbooks.Open ("$XlsCur") ; (error generated on above line)
|
|
Top
|
|
|
|
#117160 - 2004-04-01 02:40 AM
Re: Problem Openning Excel File
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
Taking a stab here, can't test, but since its running under the scheduler try this after your create (just wading through object properties) ...
$oXL.Interactive = 0
Might want to join me at MSDN here.
|
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 2220 anonymous users online.
|
|
|