The only thing I see wrong is that the Hello method doesn't take any arguments, but the VB code is passing one. It works fine for me if I remove the arg. When registered with --debug, you should still be able to see the output in Pythonwin's trace collector window even when the object is instantiated via VB.
hth Roger "ago" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I am trying to make the win32com HelloWorld server work with a VBA > client but I get: > > Run-time error '-2147467259(80004005)': > Automation error > Unspecified error > > I googled for the error but the suggested solutions (commenting out > _reg_class_spec_ and putting the server on the python path) do not seem > to make any difference (to be precise, unless I comment out > _reg_class_spec_ I cannot register the server at all) . The server > works under the python client but not on excel vba. I also tried to > debug with win32traceutil.py but I can only see the trace when using > the python client, not with excel. Any hint would be appreciated. > > ### PYTHON SERVER ### > class HelloClass: > _reg_desc_ = "Python Test COM Server" > _reg_clsid_ = "{91281AFC-25DF-4400-8868-FDBFCA2612A2}" > _reg_progid_ = "Python.HelloHello" > _public_methods_ = ['Hello'] > > def __init__(self): pass > def Hello(self): return "Hello" > > if __name__ == "__main__": > import win32com.server.register > import sys > #sys.argv.append("--debug") > win32com.server.register.UseCommandLine(HelloClass) > > ### PYTHON CLIENT (WORKS) ### > import win32com.client > obj = win32com.client.Dispatch('Python.HelloHello') > print obj.Hello() > > ### VBA CLIENT (ERROR 80004005 WHEN EXECUTING "CreateObject") ### > Public Sub test() > Dim obj As Object > Set obj = CreateObject("Python.HelloHello") > MsgBox obj.Hello("ago") > End Sub > ----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups ---= East/West-Coast Server Farms - Total Privacy via Encryption =--- -- http://mail.python.org/mailman/listinfo/python-list