Page 1 of 1 1
Topic Options
#188355 - 2008-06-25 05:01 PM IDispatch pointers error
mojo1979 Offline
Fresh Scripter

Registered: 2008-06-25
Posts: 10
Hi,

I am using Desktop Authority to create a post-engine script that will make some registry changes to MS Office so that the correct username and initials are present within the personalised settings in Word, Excel etc. I have tested this as a .vbs script and it works perfectly. However once this script is used with Desktop Authority, and hence it is converted to a .kix file then I get the follwoing error message:

Error: IDispatch pointers not allowed in expressions!
Script: \\domaincontroller\netlogon\officeresetid.kix
Line: 9

The contents of the .kix file is below:

; ScriptLogic Custom Script File
; File Name: officeidreset.kix
; Description: officeidreset.kix
;
;----------------------------------------------------------

Set objSysInfo = CreateObject("ADSystemInfo")

strUser = objSysInfo.UserName
Set objUser = GetObject("LDAP://" & strUser)

Set objWord = CreateObject("Word.Application")
objWord.UserName = objUser.givenName & " " & objUser.SN
objWord.UserInitials = Left(objUser.givenName, 1) & Left(objUser.SN, 1)
objWord.quit
;----------------------------------------------------------
RETURN ; Must be last line of file. Do not remove this line

Any ideas how I can get this to work?

Cheers

Steven

Top
#188361 - 2008-06-25 06:01 PM Re: IDispatch pointers error [Re: mojo1979]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Please don't duplicate post, it's very bad form.
Top
#188362 - 2008-06-25 06:06 PM Re: IDispatch pointers error [Re: Richard H.]
mojo1979 Offline
Fresh Scripter

Registered: 2008-06-25
Posts: 10
Sorry...
Top
#188368 - 2008-06-25 10:09 PM Re: IDispatch pointers error [Re: mojo1979]
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Looking at this.. It resembles VB Scripting. Have you tried posting over at the ScriptLogic site?

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#188377 - 2008-06-26 02:27 AM Re: IDispatch pointers error [Re: mojo1979]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
IDispatch pointers are not allowed etc. errors are most commonly caused by uncatched method calls that are not sent to a variable.
KiXtart tries to redirect them to something not very pleasant (stdout iirc?) and chokes.

My crystal ball tells me it is ... wait .... objWord.quit

Try to redirect to a dummy var.
_________________________



Top
#188379 - 2008-06-26 02:45 AM Re: IDispatch pointers error [Re: Jochen]
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
On second thought...

try to throw strUser into a file, stdout, whereever you can tell what the value really is. Plus do some error checking on Set objSysInfo = CreateObject("ADSystemInfo")

Oh and as a nB.: the script you have just posted is not, I repeat, NOT a KiXtart script!

And what the green thing is Desktop Authority????

_________________________



Top
Page 1 of 1 1


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

Who's Online
0 registered and 405 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.058 seconds in which 0.028 seconds were spent on a total of 13 queries. Zlib compression enabled.

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