ssn642 has asked for the wisdom of the Perl Monks concerning the following question:

Is there a way in Perl using WIN32::OLE to sort an excel spreadsheet after adding data to the bottom of the spreadsheet. I have looked on the internet and have not found any useful information or examples. Any help would be appreciated. Thank you.

Replies are listed 'Best First'.
Re: Win32::OLE question using Excel
by technojosh (Priest) on Oct 17, 2007 at 19:46 UTC
    Try something like:
    # Order Rows $tmp = "$mylastcol2".'3'; $Rangea = $Sheet->Range("a1"); $Rangeb = $Sheet->Range("a5"); $Excel->Selection->Sort({Key1 => $Rangea, Order1 => xlDescending, Key2 => $Rangeb});

    Though i never can find much documentation on the sort function, so you may need to play around with it a bit.

    edit - also found a sort example:
    here

      Thank you for the quick response. I will see what I can work out with the examples that you sent me. Much appreciated!