I'mn afraid you need to read through the _dynamic_ implementation to see how things work. The COM object must list the public methods and attributes in _public_methods_ etc before they will be exposed to COM - which is necessary to ensure the COM semantics are implemented by Python. VB knows only about COM, not Python, so asking how VB can leverage __setitems__ etc doesn't make sense - the question is what *COM* techniques you can use from VB.
I'm afraid I'm having trouble distilling a question I can answer though - maybe you need to be more specific, possibly including code samples. Mark > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of Ivan > Sent: Thursday, 22 February 2007 10:20 PM > To: python-win32@python.org > Subject: [python-win32] DynamicProxies for VBA > > > Hi guys, I have a couple of newbie questions, as the win32com > stuff has been > my first exposure to python. > > I managed to create python com wrappers with a DynamicPolicy, > answering using > _dynamic_ and I managed to create objects responding to > methods declared in > _public_methods_ > > I am now trying to create a dynamic proxy in python that I > can expose to VBA > and that can deal with arbitrary attribute assignments > dynamically. I tried > to implement __setitem__ with the defaul policy, but I don't > seem to be able > to get VBA to see it. I thought this might work under a > dynamic policy, but > everything gets trapped by _dynamic_ instead. > > So my questions are: > * how do you get VBA to leverage __setitem__ and __getitem__ ? > * how can I mix _dynamic_ handling of unknown methods with > default handling of > _public_methods_ ? > > thanks in advance for your help.. I am looking forward to > throw away 90% of my > VBA code. > > Ivan > > _______________________________________________ > Python-win32 mailing list > Python-win32@python.org > http://mail.python.org/mailman/listinfo/python-win32 > _______________________________________________ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32