If I understand you correctly, you are talking about Excel's AutoFilters. Using Win32::OLE, you should be able to make this work... According to the documentation at Microsoft, the AutoFilter method applies to a Range. So, you would have something on this line...
use Win32::OLE; my $ex=Win32::OLE->new('Excel.Application'); $ex->{Visible}=1; my $book=$ex->Workbooks->Add; my $sheet=$book->Worksheets(1); ## Here you would populate the spreadsheet ## I assume that the titles of the columns are contained in ## cells A1-Z1 here... $sheet->Range("a1:z1")->AutoFilter; ## Now you have dropdowns for columns A1-Z1 that let you ## filter on the given column.
The M$ page cited will give you more options on the use of AutoFilter (you can pre-program the filter, for instance).

This assumes that you are running on a Windows platform so you can use OLE, of course -- WriteSpreadsheet is cross-platform, but I haven't used it.


In reply to Re: Excel, Drop Down Menu, and Perl by mpolo
in thread Excel, Drop Down Menu, and Perl by qball

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.