Page 1 of 1 1
Topic Options
#69059 - 2002-08-15 06:08 PM Script Problem
Anonymous
Unregistered


I am having an issue with my script that i wrote to process a log file into an excel spread sheet. I am not sure what happened, but it nolonger seems to be processing correctly. I have didn't make any changes the script itself since the last time i used it.

The error that i am getting is :
Script error: IDispatch pointers not allowed in expressions!

Here is the excert of the code that seems to be causing the problem.

code:
 
Gets $FileName

$oxl = CreateObject("EXCEL.application")

if @error = 0
$oXL.Visible = 1 ; make Excel visible to the user

$Rc = $oXL.Workbooks.Add ; add a new workbook




If Open(3,$FileName)=0
$oxl.sheets.add
$oxl.Sheets("Sheet4").Select
$oxl.Sheets("Sheet4").Name="Summary"

Thanks
Bryan

Top
#69060 - 2002-08-15 06:19 PM Re: Script Problem
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Is that the whole script? You seem to be missing "endif's".
if...endif

[ 15. August 2002, 18:19: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#69061 - 2002-08-15 06:27 PM Re: Script Problem
Anonymous
Unregistered


No this is just the first few lines of the script. The script itself is pretty long. I only put in the part where the error occurs. I am now wondering if it is the way i am launching Excel.
Top
#69062 - 2002-08-15 06:34 PM Re: Script Problem
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
well, you are looking for something like:

? "name: " + $oxl.Sheets("Sheet4").Name

See: IDispatch Error by $objconn.Execute Command
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#69063 - 2002-08-15 06:44 PM Re: Script Problem
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
yeah... idispatch...

would run with debug.
if one of these:
$oxl.sheets.add
$oxl.Sheets("Sheet4").Select

return anything, the return value should be supressed.

also:
$oXL.Visible = 1

bothers the eye as other ones are made with tiny letters and this one has capitals...
_________________________
!

download KiXnet

Top
#69064 - 2002-08-15 08:01 PM Re: Script Problem
Anonymous
Unregistered


Thanks For your help, i got the code debugged and the script runs again [Big Grin]
Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 675 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.053 seconds in which 0.025 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org