[python-win32] com error

Mark Hammond mhammond at skippinet.com.au
Tue Nov 8 04:11:15 CET 2005


> "C:\Python22\Lib\site-packages\win32com\client\__init__.py",
> line 446, in _ApplyTypes_
>     return self._get_good_object_(
> com_error: (-2147352567, 'Exception occurred.', (0,
> None, None, None, 0, -2147024809), None)

The second value in that error tuple is the error code provided by the
object.  It didn't bother to fill in a message, but we can get one if it is
a standard COM error:

>>> pythoncom.GetScodeString(-2147024809)
'The parameter is incorrect.'
>>>

I'm not sure why it is throwing that specific error.  I guess it may be
"default params".  Try passing explicit values for all params - explicitly
pass pythoncom.Missing for ones you don't know the correct value for (the
win32com framework will currently be passing pythoncom.Empty for them - the
difference is subtle, but some objects are very picky about which one you
choose (basically, 'Empty' means an empty param will be supplied to the
object, whereas 'Missing' will tell pythoncom to not present that argument
at all))

Mark



More information about the Python-win32 mailing list