Hi all
this is part of a code for the free addin power piviot utilities
i'm getting an error on this line
the error happens if i drag the same measure twice to the values side of the piviot table if i right click i get an error
can anybody help me fix this ?
this is part of a code for the free addin power piviot utilities
Code:
Sub checkIfPivotField(control As IRibbonControl, ByRef Enabled)
'check if at least one cell in the selection is a pivot field
Dim pvtfld As PivotField
Dim isPivotField As Boolean
Dim rng As Range
For Each rng In Selection
On Error Resume Next
Set pvtfld = rng.PivotField
On Error GoTo 0
If Not pvtfld Is Nothing Then
With pvtfld
If .Orientation = xlRowField Or .Orientation = xlColumnField Then
isPivotField = isPivotField Or True
End If
End With
End If
Next
Enabled = isPivotField
End Sub
i'm getting an error on this line
Code:
If .Orientation = xlRowField Or .Orientation = xlColumnField Then
the error happens if i drag the same measure twice to the values side of the piviot table if i right click i get an error
can anybody help me fix this ?
Last edited by a moderator: