Problem setting COM property using win32com

Paul Prescod paul at prescod.net
Mon Apr 7 03:17:23 EDT 2003


I don't claim to be a win32com expert but I notice two things in your 
message that made me suspicious.

Greg Green wrote:
> I have a commercial com api that I'm trying to use with python. I am
> trying to set a property of the com object. The property is called
> Value, and I know enough to use the SetValue function. But that
> doesn't work.
> 
> Here is the code:
>     attrs.SetValue("CN_ID", 0, "0000005")
> 
> Here is the error:
> Traceback (most recent call last):
>   File "example.py", line 49, in ?
>     prmidattrs.SetValue("CN_ID", 0, "0000005")
>   File "C:\PYTHON22\lib\site-packages\win32com\client\dynamic.py", line 438, in __getattr__
>     raise AttributeError, "%s.%s" % (self._username_, attr)
> AttributeError: SmRecList.SmRecordList.SetValue
> 
> If I look at the makepy generated module, I see the method.

Why are you getting an exception in "dynamic.py" if you are using "makepy"?

How are you creating the prmidattrs object?

  Paul Prescod






More information about the Python-list mailing list