http://qs321.pair.com?node_id=419343


in reply to Spreadsheet::WriteExcel: How to change order of worksheets?

Do you know the names of the workbooks in advance so you can sort on that? You can store your worksheets in a hash so you can reference them properly later to addataand so on.
my %worksheets; foreach my $w (sort @ws_names_from somewhere){ $worksheets{$w} = $workbook->add_worksheet( $w ); }
--
Clayton

Replies are listed 'Best First'.
Re^2: Spreadsheet::WriteExcel: How to change order of worksheets?
by zeno (Friar) on Jan 04, 2005 at 18:28 UTC

    I think this may be the simplest approach. Actually, I need to parse through some of the names to avoid creating inappropriate sheets (the data gets dirty and I end up with strange sheet names like "null") sometimes. Using your hash would allow this better. Thanks.

    -- Zeno - Barcelona Perl Mongers http://barcelona.pm.org http://www.javajunkies.org
      Hmmm... Was anyone else wondering what this spreadsheet was about as they read "avoid creating inappropriate sheets (the data gets dirty"?

      I started thinking he was cataloguing "P&L of movies by classification" and had to suppress X-rated titles.

      Too bad the rest of the sentence took all the fun out of it... :)


      Mike