Python to Excell

Stefan Schukat SSchukat at dspace.de
Mon Jul 22 06:57:52 EDT 2002


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