[python-win32] automation error on VB CreateObject

Emmanuel Breton emmanuel.breton at logilab.fr
Wed Jul 28 15:46:47 CEST 2004


Hi

I have been trying to work arround an automation error for the second day and make no progress so far and would greatly appreciate your help :)

Here is my problem: Any call to 
Set com_object = CreateObject("MyModule") throws a MsgBox with the following error:
----
Runtime Error '-2147467259 (80004005)'

Automation error
Unspecified error
----

I am working at a client's on Windows Server 2003 (python 2.3) with the Pack Office 2002 (same error from Excel or Word).  
What's weird is that the same code (both the python server and the VB client) works fine at work on a Windows 2000 OS (python 2.1).

I have checked the Path and the PYTHONPATH, 
checked that I could Create my pythonCOM object from a python client:
Win32com.client.Dispath("MyModule") works fine...

I have also tried to rebuild a SimpleCOMServer and a simple client from Python Programming on Win32... 
without any more success however. 
(Still, when doing the same on my Win2000 environnement, it works great!)

If you have any idea/suggestion/answer...
Thanks

Emmanuel

Follow the code I have used for my tests:

----
Class PythonUtilities:
    _public_methods_ = [ 'SplitString' ]
    _reg_progid_ = "PythonDemos.Utilities"
    _reg_clsid_ = unique_generated_clsid
    
    def SplitString(self, val, item=None):
        import string
        if item != None: item = str(item)
        return string.split(str(val), item)

Here is the VB script (from the book too)
----
Sub python_test()
    Set PythonUtils = CreateObject("PythonDemos.Utilities")
    response = PythonUtils.SplitString("Hello from VB")
    For Each Item In response
        MsgBox Item
    Next
End Sub

-- 
Emmanuel Bréton                                 LOGILAB, Paris (France)
Tel: 01 45 32 03 12                              http://www.logilab.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.python.org/pipermail/python-win32/attachments/20040728/e2e6bbbf/attachment.pgp


More information about the Python-win32 mailing list