Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Excel.Worksheet activeWorksheet = ((Excel.Worksheet)Globals.ThisAddIn.Application.ActiveSheet);
- foreach (PivotTable pt in activeWorksheet.PivotTables())
- {
- foreach (PivotField pf in pt.PivotFields())
- {
- if (pf.Name == "Year" && pf.Orientation == Excel.XlPivotFieldOrientation.xlPageField)
- {
- //pf.CubeField.EnableMultiplePageItems = true;
- //pf.ClearAllFilters();
- // pf.CurrentPageName = arr.ToString();
- // pf.CurrentPage = "(All)";
- string[] ar = new string[3] { "2014", "2015", "2016" };
- // pf.CurrentPageList = ar;
- pf.VisibleItemsList = ar;
- }
- }
- pt.ManualUpdate = false;
- }
Add Comment
Please, Sign In to add comment