Guest User

Untitled

a guest
Jan 16th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. Excel.Worksheet activeWorksheet = ((Excel.Worksheet)Globals.ThisAddIn.Application.ActiveSheet);
  2.  
  3. foreach (PivotTable pt in activeWorksheet.PivotTables())
  4. {
  5. foreach (PivotField pf in pt.PivotFields())
  6. {
  7. if (pf.Name == "Year" && pf.Orientation == Excel.XlPivotFieldOrientation.xlPageField)
  8. {
  9. //pf.CubeField.EnableMultiplePageItems = true;
  10. //pf.ClearAllFilters();
  11. // pf.CurrentPageName = arr.ToString();
  12. // pf.CurrentPage = "(All)";
  13. string[] ar = new string[3] { "2014", "2015", "2016" };
  14.  
  15. // pf.CurrentPageList = ar;
  16. pf.VisibleItemsList = ar;
  17. }
  18. }
  19. pt.ManualUpdate = false;
  20. }
Add Comment
Please, Sign In to add comment