Is there a way to push data into Microsoft Excel & Word from Python ?

Discussion in 'Python' started by The Night Blogger, Dec 16, 2006.

  1. Is there a way to push data to Microsoft Excel & Word from a Python
    Application

    Is this a cross platform feature ? I'll need to push data on MS Windows &
    Mac OS X ....
     
    The Night Blogger, Dec 16, 2006
    #1
    1. Advertising

  2. The Night Blogger wrote:
    > Is there a way to push data to Microsoft Excel & Word from a Python
    > Application


    On Windows, it's easy after you install the win32 extensions. For
    example, for
    python:

    import win32com.client
    xl = win32com.client.Dispatch('Excel.Application')

    after which you can operate on "xl" (almost) as if you were coding in
    VBA. I have driven Excel from python a /lot/, and it works well.
    Paul Boddie has written a great tutorial---which includes some Outlook
    examples, btw---over here:

    http://thor.prohosting.com/~pboddie/Python/COM.html

    > Is this a cross platform feature ? I'll need to push data on MS Windows &
    > Mac OS X ....


    I have zero OSX experience, but 30s of googling brings up this:

    http://appscript.sourceforge.net/

    Kevin Walzer mentions on this mailing list entry:

    http://mail.python.org/pipermail/python-list/2006-August/400255.html

    that Excel provides reasonably good support for applescript, but again,
    I have no idea whether these things work; I'm just doing your googling
    for you.

    Assuming applescript works, you may want to write a thin wrapper over
    the combination of the win32 COM interface and the applescript
    interface that at least lets your business logic sit in one place. The
    wrapper can use the right API depending on the platform it finds itself
    on at runtime.

    Regards
    Caleb
     
    Caleb Hattingh, Dec 16, 2006
    #2
    1. Advertising

  3. The Night Blogger

    John Machin Guest

    The Night Blogger wrote:
    > Is there a way to push data to Microsoft Excel & Word from a Python
    > Application
    >
    > Is this a cross platform feature ? I'll need to push data on MS Windows &
    > Mac OS X ....


    Depends on what you mean by "push". If you wish to create Excel files
    but not update existing ones, you might consider pyExcelerator. It is
    pure Python and therefore will run on any platform that Python will.
    http://cheeseshop.python.org/pypi/pyExcelerator/

    Cheers,
    John
     
    John Machin, Dec 16, 2006
    #3
  4. The Night Blogger

    Paul Boddie Guest

    Paul Boddie, Dec 17, 2006
    #4
  5. Hi Paul

    > Thanks for the kind words!


    No, thank _you_ for taking the time to write such a useful document.

    regards
    Caleb
     
    Caleb Hattingh, Dec 21, 2006
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. The Night Blogger
    Replies:
    1
    Views:
    302
    Gabriel Genellina
    Dec 17, 2006
  2. The Night Blogger
    Replies:
    5
    Views:
    322
    Max M
    Dec 18, 2006
  3. XyZaa
    Replies:
    0
    Views:
    601
    XyZaa
    Jul 19, 2007
  4. fniles
    Replies:
    6
    Views:
    682
    Karl E. Peterson
    Apr 27, 2009
  5. samppi
    Replies:
    27
    Views:
    546
    David A. Black
    Dec 5, 2007
Loading...

Share This Page