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

I am trying to user both:
use Spreadsheet::WriteExcel; use Spreadsheet::WriteExcelXML;
when I use:
$worksheet->autofilter('A1:D11');
I get the error:
Can't locate object method "autofilter" via package "Spreadsheet::Writ +eExcel::Worksheet" at fsc_test7.pl line 1275.
I've omitted the 'use Spreadsheet::WriteExcel;' and just used 'use Spreadsheet::WriteExcelXML;' for the whole file, and I get the error:
Can't locate object method "autofilter" via package "Spreadsheet::Writ +eExcelXML::Worksheet" at fsc_test7.pl line 1275.
Does anybody have any experience with autofilter on writeexcelXML and can point me in a direction. I did a search of perlmonks and google, but have yet to run into anything.

Thanks,
Kevin

Replies are listed 'Best First'.
Re: spreadsheet writeexcelxml autofilter
by jmcnamara (Monsignor) on May 15, 2006 at 22:54 UTC

    Autofilters aren't supported in Spreadsheet::WriteExcel. They are only supported in Spreadsheet::WriteExcelXML.

    If you are getting a "Can't locate object method" error then your version of the module is probably less than 0.10 and you should upgrade to the latest version.

    Here is an autofilter example program.

    --
    John.

Re: spreadsheet writeexcelxml autofilter
by marto (Cardinal) on May 15, 2006 at 21:52 UTC
    hi kenguy,

    regards Spreadsheet::WriteExcel the documentation does not mention an autofilter method, however under the "To Do" section it reads

    "The roadmap is as follows:
  • Fix insert_bitmap to work with write_comment(), OpenOffice.org and Gnumeric.
  • Add AutoFilters.
  • Add better defaults for Excel on the Mac.
  • "

    Regarding use Spreadsheet::WriteExcelXML can you post all of the code you are using? It is quite difficult to tell what may or may not be the problem without seeing exactly what is going on.

    hope this helps.

    Martin