Attribute VB_Name = "Module4" Sub Script_08_26_33_08_07_2021(Parameters As Scripting.Dictionary) On Error GoTo skip ' ' Macro6 Macro ' ' Workbooks.Open Filename:=Parameters.Item("fileArg1") Range(Parameters.Item("rangeArg1")).Select Sheets.Add ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:="Sheet1!R1C1:R4C2", Version:=6).CreatePivotTable TableDestination:="Sheet2!R3C1", TableName:="PivotTable8", DefaultVersion:=6 Sheets("Sheet2").Select Cells(3, 1).Select With ActiveSheet.PivotTables("PivotTable8") .ColumnGrand = True .HasAutoFormat = True .DisplayErrorString = False .DisplayNullString = True .EnableDrilldown = True .ErrorString = "" .MergeLabels = False .NullString = "" .PageFieldOrder = 2 .PageFieldWrapCount = 0 .PreserveFormatting = True .RowGrand = True .SaveData = True .PrintTitles = False .RepeatItemsOnEachPrintedPage = True .TotalsAnnotation = False .CompactRowIndent = 1 .InGridDropZones = False .DisplayFieldCaptions = True .DisplayMemberPropertyTooltips = False .DisplayContextTooltips = True .ShowDrillIndicators = True .PrintDrillIndicators = False .AllowMultipleFilters = False .SortUsingCustomLists = True .FieldListSortAscending = False .ShowValuesRow = False .CalculatedMembersInFilters = False .RowAxisLayout xlCompactRow End With With ActiveSheet.PivotTables("PivotTable8").PivotCache .RefreshOnFileOpen = False .MissingItemsLimit = xlMissingItemsDefault End With ActiveSheet.PivotTables("PivotTable8").RepeatAllLabels xlRepeatLabels With ActiveSheet.PivotTables("PivotTable8").PivotFields("Data") .Orientation = xlRowField .Position = 1 End With ActiveSheet.PivotTables("PivotTable8").AddDataField ActiveSheet.PivotTables("PivotTable8").PivotFields("Coordinator MD Name"), "Sum of Coordinator MD Name", xlSum With ActiveSheet.PivotTables("PivotTable8").PivotFields("Sum of Coordinator MD Name") .Caption = "Count of Coordinator MD Name" .Function = xlCount End With ActiveWorkbook.Save ActiveWindow.Close skip: If Err.Number <> 0 Then Parameters.Item("ScriptErrors") = Err.Description End If End Sub