Live conversation between Python and an Excel spreadsheet

Q

quadric

Hi,
I have an application that requires that Python initiate and mediate a live
and iterative conversation
between an external application (in which Python is embedded) and an
external Excel
spreadsheet. Python will have to pass info to the spreadsheet, spreadsheet
will make
calculations, Python will obtain results and pass back to
application, application will evaluate
results of spreadsheet calculations and create new set of data and
instructions, Python will pass
new data and instructions to spreadsheet, loop goes on 'n' times until
convergence to solution
or no solution. Python terminates conversation and returns control to
application until next
'conversation'.

If I had my choice (which I don't) I would re-code the spreadsheet in
Python, but that is not an
option in this case.

Is there anyone on the list that has done this before and has an elegant
solution? If so, what Python modules should I look at? Are there any good
Python books out there that have
examples of this?

I am experienced with Python and have some knowledge of COM objects etc....

Any help would be very much appreciated.

Thanks
 
S

Steve Holden

Hi,
I have an application that requires that Python initiate and mediate a
live and iterative conversation
between an external application (in which Python is embedded) and an
external Excel
spreadsheet. Python will have to pass info to the spreadsheet,
spreadsheet will make
calculations, Python will obtain results and pass back to application,
application will evaluate
results of spreadsheet calculations and create new set of data and
instructions, Python will pass
new data and instructions to spreadsheet, loop goes on 'n' times until
convergence to solution
or no solution. Python terminates conversation and returns control to
application until next
'conversation'.

If I had my choice (which I don't) I would re-code the spreadsheet in
Python, but that is not an
option in this case.

Is there anyone on the list that has done this before and has an elegant
solution? If so, what Python modules should I look at? Are there any
good Python books out there that have
examples of this?

I am experienced with Python and have some knowledge of COM objects etc....

Any help would be very much appreciated.

Thanks
Your best bet would be to interact with Excel as a COM object, as
described in the excellent "Python Programming on Win32" by Robinson and
Hammond. However, be aware that you'll probably end up ferreting around
to find out about undocumented methods of Excel objects, as the docs are
often far from complete.

regards
Steve
 
S

Steve Holden

Hi,
I have an application that requires that Python initiate and mediate a
live and iterative conversation
between an external application (in which Python is embedded) and an
external Excel
spreadsheet. Python will have to pass info to the spreadsheet,
spreadsheet will make
calculations, Python will obtain results and pass back to application,
application will evaluate
results of spreadsheet calculations and create new set of data and
instructions, Python will pass
new data and instructions to spreadsheet, loop goes on 'n' times until
convergence to solution
or no solution. Python terminates conversation and returns control to
application until next
'conversation'.

If I had my choice (which I don't) I would re-code the spreadsheet in
Python, but that is not an
option in this case.

Is there anyone on the list that has done this before and has an elegant
solution? If so, what Python modules should I look at? Are there any
good Python books out there that have
examples of this?

I am experienced with Python and have some knowledge of COM objects etc....

Any help would be very much appreciated.

Thanks
Your best bet would be to interact with Excel as a COM object, as
described in the excellent "Python Programming on Win32" by Robinson and
Hammond. However, be aware that you'll probably end up ferreting around
to find out about undocumented methods of Excel objects, as the docs are
often far from complete.

regards
Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top