Python to Excell

pixie888 at hotmail.com pixie888 at hotmail.com
Mon Jul 22 08:46:09 EDT 2002


Thank you,

Do you have any suggestion/clues on how to use that module, there is
quite some functionality in it. Some sample code to get started would
be great. I am not a very experienced programmer... 

Henk



On Mon, 22 Jul 2002 11:57:52 +0100, Stefan Schukat
<SSchukat at dspace.de> wrote:

>Sorry missing gencache
>
>-> 
>
>from win32com.client import gencache
>gencache.EnsureDispatch('Excel.Application', 0)
>
>
>	Stefan
>
>-----Original Message-----
>From: pixie888 at hotmail.com [mailto:pixie888 at hotmail.com]
>Sent: Monday, July 22, 2002 10:48 AM
>To: python-list at python.org
>Subject: Re: Python to Excell
>
>
>On Mon, 22 Jul 2002 09:49:33 +0100, Stefan Schukat
><SSchukat at dspace.de> wrote:
>
>>Search for excel8/9/10.olb an run makepy on it. There you'll have 
>>all the classes available from Excel. 
>>
>>or run "win32com.client.EnsureDispatch('Excel.Application', 0)"
>>and search the [PYTHON_ROOT]\Lib\site-packages\win32com\gen_py
>>directory for the generated module.
>
>When I try the code above I get:
>>>> import win32com
>>>> win32com.client.EnsureDispatch('Excel.Application', 0)
>Traceback (most recent call last):
>  File "<interactive input>", line 1, in ?
>AttributeError: 'win32com' module has no attribute 'client'
>>>> from win32com import client
>>>> win32com.client.EnsureDispatch('Excel.Application', 0)
>Traceback (most recent call last):
>  File "<interactive input>", line 1, in ?
>AttributeError: 'win32com.client' module has no attribute
>'EnsureDispatch'
>
>Any idea?
>
>>
>>or use the macro recorder of excel and translate it to python code
>>
>>or use the excel online help
>>
>>or buy a book "Python Programming on Win32" 
>>
>>or ...
>>
>>
>>	Stefan
>>
>>
>>-----Original Message-----
>>From: pixie888 at hotmail.com [mailto:pixie888 at hotmail.com]
>>Sent: Monday, July 22, 2002 8:33 AM
>>To: python-list at python.org
>>Subject: Python to Excell
>>
>>
>>Hi all,
>>
>>I want to use Python to automate Excell. What I want to do is writing
>>a script which updates an Excell sheet and which prints it out then. I
>>know the stuff about DispatchEx but I do not know the interface which
>>is exposed by Excell.  Can anybody help me further on this one?
>>
>>Thanks,
>>
>>Henk 
>>-- 
>>http://mail.python.org/mailman/listinfo/python-list
>>
>>
>
>-- 
>http://mail.python.org/mailman/listinfo/python-list
>
>




More information about the Python-list mailing list