interfacing to a remote excel app

Harry George harry.g.george at boeing.com
Mon Apr 26 10:56:25 EDT 2004


Bram Stolk <bram at nospam.sara.nl> writes:

> 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: bram at nospam.sara.nl   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.)



-- 
harry.g.george at boeing.com
6-6M21 BCA CompArch Design Engineering
Phone: (425) 342-0007



More information about the Python-list mailing list