[Tutor] Catching OLE error

Alan G alan.gauld at freenet.co.uk
Thu Jul 14 23:21:04 CEST 2005

> Isn't the OLEError alike the ValueError, KeyError and so on? 
> If so shouldn't it go before the colon?

The problem, as I understand it, is that OLEError is not coming 
from Python but from COM.

So the errors are getting raised before Python even knows there 
is a problem, so it cannot catch them in an except block.
>From my very limited expoerience of COM programming I'd guess 
that there is a type mismatch somewhere either in the data you 
are passing in or in the data you are getting back.

But thats just a guess based on the fact that at lreast 80% of
my COM programming errors have been data type inconsistencies!


Alan G.

More information about the Tutor mailing list