interfacing to a remote excel app

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bram Stolk

    interfacing to a remote excel app

    pyHello,


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



    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@nospam.sar a.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
    ------------------------------------------------------------------------------
  • Guyon Morée

    #2
    Re: interfacing to a remote excel app

    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" <bram@nospam.sa ra.nl> wrote in message
    news:2004042615 0428.69010a3c@p istache.sara.nl ...[color=blue]
    > 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[/color]
    rows).[color=blue]
    > 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.
    >
    > --
    > --------------------------------------------------------------------------[/color]
    ----[color=blue]
    > Bram Stolk, VR Engineer.
    > SARA Academic Computing Services Amsterdam, PO Box 94613, 1090 GP[/color]
    AMSTERDAM[color=blue]
    > email: bram@nospam.sar a.nl Phone +31-20-5923059 Fax +31-20-6683167
    >
    > "For the costs of subsidized agriculture in the EU, we can have all 56[/color]
    million[color=blue]
    > European cows fly around the world. First Class." - J. Norberg
    > --------------------------------------------------------------------------[/color]
    ----


    Comment

    • Harry George

      #3
      Re: interfacing to a remote excel app

      Bram Stolk <bram@nospam.sa ra.nl> writes:
      [color=blue]
      > 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@nospam.sar a.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
      > ------------------------------------------------------------------------------[/color]

      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@ boeing.com
      6-6M21 BCA CompArch Design Engineering
      Phone: (425) 342-0007

      Comment

      • Cameron Laird

        #4
        IronPythoneers in the house? (was: interfacing to a remote excel app)

        In article <xqxad0yvld2.fs f@cola2.ca.boei ng.com>,
        Harry George <harry.g.george @boeing.com> wrote:

        Comment

        • Michel Claveau/Hamster

          #5
          Re: interfacing to a remote excel app

          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
          --
          Michel Claveau
          mél : http://cerbermail.com/?6J1TthIa8B
          site : http://mclaveau.com






          Comment

          • Brian Kelley

            #6
            Re: interfacing to a remote excel app

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



            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

            Comment

            Working...