comtypes icon indicating copy to clipboard operation
comtypes copied to clipboard

Cannot use MS Office objects, importing the MSO tlb fails

Open chrullrich opened this issue 5 years ago • 1 comments

Hello,

while generating the Python type library equivalents for the MS Office object model (for x86) has always been a bit fragile, it appears that it does not work at all now, at least with Python 3.8 (not sure about recent 3.7s). The symptom is

TypeError: item 1 in _argtypes_ passes a union by value, which is unsupported.

This happens with methods on various interfaces (probably randomized by a dictionary hash somewhere). The common factor between all of them is that they have a VARIANT argument, and VARIANT is a union, of course.

I think the reason that it now fails reliably is the recent fix for https://bugs.python.org/issue16575.

Is there some way to work around this limitation, other than using pywin32 instead?

chrullrich avatar Dec 23 '19 17:12 chrullrich

This has been reverted in python for now: https://github.com/python/cpython/pull/17960

mrginglymus avatar Jan 14 '20 11:01 mrginglymus

@chrullrich @mrginglymus

If the issue remains, please re-open.

junkmd avatar Dec 03 '22 05:12 junkmd