interfacing to a remote excel app

B

Bram Stolk

pyHello,


Google helped me find a nice package to interface python with MS Excel.
"win32all", or sometimes called by the name "pywin32".

http://starship.python.net/crew/mhammond/

However, this win32all extension seems to be specifically built for the
windows platform only.

What could I use if I want to interface to excel from a python interpreter
running on a remote UNIX machine?

The specific task I want to accomplish is as follows:
I want python on UNIX to be able to make selections in excel (highlight rows).
Also, I want to have changes in the selected (highlighted) items in excel
to be communicated to the python running on UNIX.

What would be the best way to do this?

Thanks,

Bram

PS: A possible approach would be to run two interpreters, one on both
platforms, and have the MS python talk to excel. However, I would like a
solution with low-impact to the MS platform, and want to get away without
having to install python and win32all on the MS machine.

--
------------------------------------------------------------------------------
Bram Stolk, VR Engineer.
SARA Academic Computing Services Amsterdam, PO Box 94613, 1090 GP AMSTERDAM
email: (e-mail address removed) Phone +31-20-5923059 Fax +31-20-6683167

"For the costs of subsidized agriculture in the EU, we can have all 56 million
European cows fly around the world. First Class." - J. Norberg
------------------------------------------------------------------------------
 
G

Guyon Morée

Let me start by saying, that I don't have a 'solution-to-go' on this, but
I'll give it a go anyway.

An idea would be to investigate on DCOM (Distributed COM) and accessing that
from Unix. I have no clue on how to do this, so I leave that as an exercise
for yourself.

Otherwise...

If you have no problem having 2 seperate interpeters, It's fairly easy to
come up with a small xml-rpc interface and acces it through that.

just my 2 cents,

ps. de groeten aan Gijs en Bas :)

Bram Stolk said:
pyHello,


Google helped me find a nice package to interface python with MS Excel.
"win32all", or sometimes called by the name "pywin32".

http://starship.python.net/crew/mhammond/

However, this win32all extension seems to be specifically built for the
windows platform only.

What could I use if I want to interface to excel from a python interpreter
running on a remote UNIX machine?

The specific task I want to accomplish is as follows:
I want python on UNIX to be able to make selections in excel (highlight rows).
Also, I want to have changes in the selected (highlighted) items in excel
to be communicated to the python running on UNIX.

What would be the best way to do this?

Thanks,

Bram

PS: A possible approach would be to run two interpreters, one on both
platforms, and have the MS python talk to excel. However, I would like a
solution with low-impact to the MS platform, and want to get away without
having to install python and win32all on the MS machine.

--
-------------------------------------------------------------------------- ----
Bram Stolk, VR Engineer.
SARA Academic Computing Services Amsterdam, PO Box 94613, 1090 GP AMSTERDAM
email: (e-mail address removed) Phone +31-20-5923059 Fax +31-20-6683167

"For the costs of subsidized agriculture in the EU, we can have all 56 million
European cows fly around the world. First Class." - J. Norberg
--------------------------------------------------------------------------
----
 
H

Harry George

Bram Stolk said:
pyHello,


Google helped me find a nice package to interface python with MS Excel.
"win32all", or sometimes called by the name "pywin32".

http://starship.python.net/crew/mhammond/

However, this win32all extension seems to be specifically built for the
windows platform only.

What could I use if I want to interface to excel from a python interpreter
running on a remote UNIX machine?

The specific task I want to accomplish is as follows:
I want python on UNIX to be able to make selections in excel (highlight rows).
Also, I want to have changes in the selected (highlighted) items in excel
to be communicated to the python running on UNIX.

What would be the best way to do this?

Thanks,

Bram

PS: A possible approach would be to run two interpreters, one on both
platforms, and have the MS python talk to excel. However, I would like a
solution with low-impact to the MS platform, and want to get away without
having to install python and win32all on the MS machine.

--
------------------------------------------------------------------------------
Bram Stolk, VR Engineer.
SARA Academic Computing Services Amsterdam, PO Box 94613, 1090 GP AMSTERDAM
email: (e-mail address removed) Phone +31-20-5923059 Fax +31-20-6683167

"For the costs of subsidized agriculture in the EU, we can have all
56 million European cows fly around the world. First Class." -
J. Norberg
------------------------------------------------------------------------------

You are going to have to do *something* on the MS Excel box.
Otherwise you have a security nightmare (I'm now accessing your Excel
spreadsheet, and I don't even have to tell you about it.)

So it is a matter of how much work you are willing to do on the MS
box. Installing a py2exe bundle is pretty straightforward, so I'm not
sure this is a stumbling block. You could do a proxy with
Python-and-pywin32 talking to Excel via COM, and to the LAN via Pyro
or XMLRPC or SOAP.

Other than that, you could try to setup remote access to Excel.NET via
..NET remoting, and try to reach that from Mono or DotGNU. But .NET
and its clones are not very Python-friendly, so the bindings may not
be available. Even if you got it to work, you would be in a Microsoft
lockin situation, subject to changing protocols as .NET evolved (and
as patent fights perhaps made non-MS implementaitons difficult.)
 
C

Cameron Laird

.
[considerable wisdom
about security, MS
lock-in, and archi-
tecture]
.
.
.NET remoting, and try to reach that from Mono or DotGNU. But .NET
and its clones are not very Python-friendly, so the bindings may not
be available. Even if you got it to work, you would be in a Microsoft
.
.
.
I suspect we should be careful what we say (at least in
public) about compatibility with .NET. I hope someone
more knowledgeable on this score than I will jump in soon.

I entirely agree with the conclusion that the original
poster has ... well, he's going to need changes, no matter
what Python's capabilities are.
 
M

Michel Claveau/Hamster

Bonjour !

Pour un problème similaire, j'ai fais :

- sur la machine Windows/Excel : un script Python, petit serveur TCP, qui
pilote Excel par COM
- sur la machine distante un autre script Python envoie ses instructions
"Excel", via TCP, et reçoit la réponse en retour.

Résultat : ça marche bien, même à travers Internet.


In english (try) :

Hi !

For a similar problem, I have make:
- on the Windows/Excel machine: a script Python, little server TCP, which
controls Excel by COM
- on the distant machine another Python script sends its instructions
"Excel", via TCP, and receive the response in return.

Result: it goes well, even through Internet.




@-salutations
 
B

Brian Kelley

One solution that I have used is a COM/CORBA bridge. A fairly decent
one is here:

http://www.octatec.co.uk/CB_sum.htm

But it still requires installation on the windows box. Your goal is
pretty easy actually if you can install python on the windows box.

Now for a completely off the wall suggestion. Have you tried win32all
and DCOM running under wine (linux win32 api)? That might supply enough
of the framework for you to get things running. I'd be very interested
if you can get this to work :)

Brian Kelley
 

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

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top