[python-win32] Python COM Server and VB6 Integration

J.D. Main jdmain at comcast.net
Sat Jul 18 17:59:50 CEST 2009


Hi Folks,

Hopefully this is the place to ask this question.  

I have written a COM server with a few trivial string methods to test the
integration of Python and VB6 (and Visual Studio).  I have "compiled" it with
py2exe and created a DLL that can actually register with Windows.  Nice.

I have successfully accessed the method of this COM Server from VBA (using MS Word) 
and also with Python (thanks Mark Hammond for the examples).  In addition, with some 
simple copy and paste, the VBA code will execute within the VB6 environment.  So my code 
and my COM interface does actually work.  

BTW - I am not a VB guy. I just want to create Python DLLs to do useful things in the 
programs of others.

However, my DLL can not be added as a reference to a VB6 or a VS2003 project. 
Both say it's not a valid DLL and thus it does not show up in any of their
"reference object" lists.  That basically means it's not available for use in that 
environment like other DLLs and OCXs.  In addition, any sort of "intellisense"
or call tips doesn't work.

So my question is this:  is there some special interface vodoo that needs
to be put in my code or my py2exe setup in order to get this COM server truly
visible and accessible within VB6 or Visual Studio?  

I would love to hear about any experience you may have with all this.  

Best Regards,

J.D.


More information about the python-win32 mailing list