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

Dear Monks, I was trying to use perl WIN32:OLE package to automate excel plotting pivot table, one the problem I have is after I added fields to the pivot table, I want to choose one particular value of the filter field, so everytime I plot the pivot table I don't need to choose this value by hand, I was wondering how can OLE do that, which object method or property should I change.here is the code
my @filter=("Time","Place"); my $reffilterarr=\@filter; # Open Excel File my $xlBook = $xlApp->Workbooks->Open("$mdir\\$tbcsv"); my $worksheet = $xlBook->Worksheets("$table"); my $rng = $worksheet->UsedRange; my $sheet2=$xlBook->Worksheets->Add; my $rng2 = $xlBook->ActiveSheet->Range("A1:BZ97"); my $tbl = $sheet2->PivotTableWizard(1, $rng, $rng2, "MyPivotTable"); $tbl->AddFields($refrowarr, $refcolarr, $reffilterarr); $tbl->ActiveFilters;
I want to choose a particular value in "Time" to filter the result. I was wondering where can I set this value. thanks in advance

Replies are listed 'Best First'.
Re: How to select one of the filter values
by Corion (Patriarch) on Oct 29, 2011 at 22:19 UTC