Need A script to open a excel file and extract the data using autofilter

Discussion in 'Python' started by Prakash, Oct 1, 2011.

  1. Prakash

    Prakash Guest

    Need A script to open a excel file and extract the data using
    autofilter and write it in a new sheet or new file like I have to
    select all rows in which all the columns contain pass as status
     
    Prakash, Oct 1, 2011
    #1
    1. Advertising

  2. Prakash

    Prakash Guest

    Re: Need A script to open a excel file and extract the data using autofilter

    On Oct 1, 10:25 pm, Prakash <> wrote:
    > Need  A script to open a excel file and extract the data using
    > autofilter and write it in a new sheet or new file like I have to
    > select all rows in which all the columns contain pass as status


    from win32com.client import Dispatch
    xlApp = Dispatch("Excel.Application")
    xlApp.Workbooks.Open(r'C:\Users\Administrator\Desktop\test.xls')
    xlApp.Visible = 1

    after opening the text.xls file i need to filter all the rows in which
    the status column is passed and copy the whole sheet to another sheet
     
    Prakash, Oct 1, 2011
    #2
    1. Advertising

  3. Prakash <> wrote:
    > Need A script to open a excel file and extract the data using
    > autofilter and write it in a new sheet or new file like I have to
    > select all rows in which all the columns contain pass as status

    ... try this:
    http://www.python-excel.org/
    Regards
    Adam Przybyla
     
    Adam Przybyla, Oct 3, 2011
    #3
  4. Re: Need A script to open a excel file and extract the data usingautofilter

    On 01/10/2011 23:00, David Monaghan wrote:
    >> after opening the text.xls file i need to filter all the rows in which
    >> the status column is passed and copy the whole sheet to another sheet

    >
    > I don't do this often enough to have it to mind, so what I normally do is
    > record a Macro, convert it to VBS and then convert that to Python.


    Ouch! Slow, error prone and Windows only ;-)

    Please consider using xlrd and described on http://www.python-excel.org

    cheers,

    Chris

    --
    Simplistix - Content Management, Batch Processing & Python Consulting
    - http://www.simplistix.co.uk
     
    Chris Withers, Oct 4, 2011
    #4
  5. Prakash

    Alan Meyer Guest

    Re: Need A script to open a excel file and extract the data usingautofilter

    On 10/4/2011 5:12 PM, David Monaghan wrote:
    > On Tue, 04 Oct 2011 19:42:06 +0100, Chris Withers<>
    > wrote:
    >
    >> On 01/10/2011 23:00, David Monaghan wrote:
    >>>> after opening the text.xls file i need to filter all the rows in which
    >>>> the status column is passed and copy the whole sheet to another sheet
    >>>
    >>> I don't do this often enough to have it to mind, so what I normally do is
    >>> record a Macro, convert it to VBS and then convert that to Python.

    >>
    >> Ouch! Slow, error prone and Windows only ;-)
    >>
    >> Please consider using xlrd and described on http://www.python-excel.org

    >
    > All true! The reason I usually do it like that is I normally only need to do
    > very simple things and I usually stop at the VBS stage. And I wasn't aware
    > of xlrd - I'll give it a look.
    >
    > DaveM


    I've used xlrd. It's pretty nice.

    Alan
     
    Alan Meyer, Oct 5, 2011
    #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. Gene Ariani

    Excel AutoFilter Feature?

    Gene Ariani, Dec 1, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    653
    Gene Ariani
    Dec 1, 2003
  2. Amy B
    Replies:
    0
    Views:
    1,532
    Amy B
    Oct 22, 2004
  3. devpoint
    Replies:
    0
    Views:
    143
    devpoint
    Sep 8, 2003
  4. devpoint
    Replies:
    0
    Views:
    165
    devpoint
    Sep 2, 2003
  5. devpoint
    Replies:
    2
    Views:
    171
    devpoint
    Sep 18, 2003
Loading...

Share This Page