Problem with using PythonWin and ActiveX COM Object

Jeremy Howard jeremyh at flashcom.com
Tue Oct 3 17:09:19 EDT 2000


I've asked this before but never really got an answer. I'm working for a
company that is using Siebel CRM software.  This software comes with COM
objects for accessing their system from external applications.  Below is the
VB code that works and the Python code that doesn't.  If anyone has a
solution I'd really appreciate it.

VB Code...

Dim iErr as Integer
Dim objSiebel as Object

Set objSiebel = CreateObject("SiebelDataServer.ApplicationObject")

objSiebel.LoadObjects("ConfigFile", iErr)

<snip>
the vb code above works fine with no problems.



Python Code...

import win32com.client

iError = 0

objSiebel = win32com.client.Dispatch("SiebelDataServer.ApplicationObject")

objSiebel.LoadObjects("C:\\siebel\\bin\\psblprd.cfg", iError )

<snip>

the python code above throws the following error..

Traceback (most recent call last):
  File "C:\Python16\Pythonwin\pywin\framework\scriptutils.py", line 301, in
RunScript
    exec codeObject in __main__.__dict__
  File "C:\Development\Java\MX\testSiebel.py", line 7, in ?
    objSiebel.LoadObjects("C:\\siebel\\bin\\psblprd.cfg", sError )
  File "<COMObject SiebelDataServer.ApplicationObject>", line 2, in
LoadObjects
com_error: (-2147352571, 'Type mismatch.', None, 2)


I'm not sure why this is happening.  I was under the impression that the
variabel iError would be an integer if assigned a numeric value (ie iError =
0).


Thanks in advance
Jeremy Howard
jeremyho at flashcom.com






More information about the Python-list mailing list