List Info

Thread: Re: Constants quit working under Python 2.5




Re: Constants quit working under Python 2.5
user name
2007-04-11 01:41:31
<kc106_2005-pywin32yahoo.com> wrote in message
news:877431.58061.qmweb51412.mail.re2.yahoo.com...
>> > Hi list,
>> >
>> > I upgraded to Python 2.5 for evaluation and
testing.
>> After installing the pywin32-210.win32-py2.5.exe, I
found that the
>> > constants module doesn't work.  For example,
this code fails:
>> >
>> >   from win32com.client import Dispatch,
constants
>> >
>> >   print constants.xlDown
>> >
>> > I re-execute makepy.py and selected
"Microsoft Office 10.0 Object
>> > Library (2.2)" but the problem persists.
>> >
>> > What should I do?
>> >
>> > Thanks,
>> >
>> > --
>> > John Henry
>>
>> xlDown appears to be in the Excel object library
rather than
>> the Office object library.
>>
>>        hth
>>            Roger
>>
>>
>>
>
> Thanks for the reply.
>
> That's the one I've been using before the migration to
2.5.  I went back and tried both Microsoft Excel 10.0 (1.4)
and 5.0 
> (1.0) Object Library and the failures are the same.
>

Try clearing out your gen_py folder and starting from
scratch.
The below works for me with 2.5.

>>> import win32com.client
>>>
xl=win32com.client.gencache.EnsureDispatch('Excel.Applicatio
n',0)
>>> print win32com.client.constants.xlDown
-4121
>>>

           Roger

_______________________________________________
Python-win32 mailing list
Python-win32python.org

http://mail.python.org/mailman/listinfo/python-win32

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )