win32com and Excel

v2ng at my-deja.com v2ng at my-deja.com
Fri Jun 16 16:12:34 EDT 2000


I'm having a problem instantiating my Python COM objects from VB6 and
Excel VBA.

My Python class is really small, a straight rip off of the PPOW
O'Reilly book.

class MoneyMarketCOMServer:
    _public_methods_ = ['testfunc']
    _reg_progid_ = "PythonMMPL.Utilities"
    _reg_clsid_ = "{186D0DF0-43BA-11D4-B806-00C04F6CFC5C}"

    def testfunc(self):
        return 'Hello world!'

if __name__ == '__main__':
    import win32com.server.register
    win32com.server.register.UseCommandLine(MoneyMarketCOMServer)


No big deal.

When I connect to it from VB or VBA using:

dim objCOM
Set objCOM = CreateObject("PythonMMPL.Utilities")
MsgBox (objCOM.testfunc())
set objCOM = Nothing

I get crashes _EXACTLY_ every other time I try to run my VB program.

I don't seem to have any problems using other COM objects from VBA.

Has anyone seen this problem before?

Vic



Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list