472,958 Members | 1,755 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 software developers and data experts.

Live conversation between Python and an Excel spreadsheet

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
Jul 18 '05 #1
2 2044
qu*****@primenet.com wrote:
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
Jul 18 '05 #2
qu*****@primenet.com wrote:
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
Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Allison Bailey | last post by:
Hi Folks, I'm a brand new Python programmer, so please point me in the right direction if this is not the best forum for this question.... I would like to open an existing MS Excel spreadsheet...
3
by: ian castleden | last post by:
From time to time I see requests for some sort of python MS Excel interface/software. I have written just such software 100% python (works with Jython too! at least it did a year ago). It was...
6
by: Wolfgang Keller | last post by:
Hello, I'm looking for a spreadsheet application (MacOS X prefered, but Windows, Linux ar available as well) with support for Python scripting (third-party "plug-ins" are ok) and a database...
0
by: MARK TURNER | last post by:
Hi, Can anyone point me in the right direction to learn how to get real time updates in an Access form from an Excel spreadsheet? I'm trying to link the following formula which exists in an...
0
by: Rich Wallace | last post by:
Hello all, Looking for suggestions and tips if possible. I have an application running on a file server that utilizes the FileSystemWatcher to trap when any Excel files are saved by a user. I...
1
by: garry.oxnard | last post by:
Can anyone help me to solve a problem which involves switching from Access to Excel (then back to Access) programatically please? I have an Excel template which, on open, also opens an Access...
0
by: Grip | last post by:
Hi, I have gone throught the group and Microsoft's online help and have seen many suggestions but I am still seeking clarity: 1. I have an excel spreadsheet. Column A contains text that may...
1
by: Sport Girl | last post by:
Hi everybody , i have the task of developing in Perl a script that retrieves data from 3 tables ( bugs, profiles, products) from a MySQL database called bugs and display them in an excel sheet...
0
by: nphankey | last post by:
I'm struggling to tame Excel using Python and COM. Most of the following code is working except for the setting of the activesheet. Also, I would like to know how to release a COM object...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.