Thanks Cetin - you da man! I was trying to set all 12 of the array indexes to False when all I need was the first. That did the trick, thanks again.
>>By default a pivottable will create subtotals for all the groupings. In one of my reports I want to turn off subtotals. I recorded a macro in Excel and it returned the following code:
>>
>>
>>ActiveSheet.PivotTables("PivotTable").PivotFields("sub_cntry").Subtotals = _
>> Array(False, False, False, False, False, False, False, False, False, False, False, False)
>>
>>
>>I tried the following two workarounds but the first will not compile and the second returns an error:
>>
>>
>>
>>DIMENSION laSubTotals[12]
>>laSubTotals = .F.
>>WITH oExcel.PivotTables("PivotTable")
>> .PivotFields("sub_cntry").SubTotals = @laSubTotals
>>
>> .PivotFields("sub_cntry").SubTotals( @laSubTotals)
>>ENDWITH
>>
>>
>>Anyone got a solution?
>
>Hi Tom,
>Try this :
>
>.PivotFields("sub_cntry").SubTotals(1) = .t.
>.PivotFields("sub_cntry").SubTotals(1) = .f.
>
>Cetin