excel vba - Filter Powerpivot with VBA -


ok, macro supposed loop through pivot's supplier filter based on list located in worksheet. after every loop has upload file intranet in .pdf format.

the entire code is:

sub adinn() dim integer, n integer  application.calculation = xlcalculatemanual  n = application.worksheetfunction.counta(worksheets("list").range("a:a")) - 1   redim supplier(n - 1, 1) string  = 1 n supplier(i - 1, 0) = worksheets("list").cells(1 + i, 1) supplier(i - 1, 1) = worksheets("list").cells(1 + i, 2) next  = 1 n sheets("to supplier").select activesheet.pivottables("pivottable1").pagefields("[query].[supplier].[supplier]").visibleitemslist = _ "[query].[supplier]." & supplier(i - 1, 0)  sheets("to supplier").calculate   sheets("to supplier").select  activesheet.exportasfixedformat type:=xltypepdf, filename:= _     "http://enterpriseweb.com/portalone/sourcing/supplier%20documents/" & supplier(i - 1, 1) _     & "/evaluations/" & supplier(i - 1, 1) & " credits.pdf" _     , quality:=xlqualitystandard, includedocproperties:=true, ignoreprintareas _     :=false, openafterpublish:=false on error resume next  next  application.calculation = xlcalculationautomatic  sheets("overview").select  end sub 

i think issue both:

supplier(i - 1, 0) = worksheets("list").cells(1 + i, 1) 'supplier name supplier(i - 1, 1) = worksheets("list").cells(1 + i, 2) 'supplier code 

when introduce them pivotitem , concatenate link.obviously, what´s supposed appear there value represent.