Orfil
New Member
Hi, guys
I have a real nuisance here, a subroutine that executes if I step through it with F8 but crashes with this error message, "Unable to set Orientation property of the PivotField class" if I run it with F5.
I didn't have this problem with Excel 2013. It only started since a clean install of Excel 2016. Is this a coincidence or did I miss a setting somewhere?
Any comments, remarks, feedback, etc. would be greatly appreciated.
Warm regards and best wishes
Orfil
I have a real nuisance here, a subroutine that executes if I step through it with F8 but crashes with this error message, "Unable to set Orientation property of the PivotField class" if I run it with F5.
Code:
' delete current datafields
For Each pf In pvt.DataFields
pf.Orientation = xlHidden
Next pf
' delete row & column fields
For Each pf In pvt.PivotFields
pf.Orientation = xlHidden <------ this is the problem line
Next pf
Any comments, remarks, feedback, etc. would be greatly appreciated.
Warm regards and best wishes
Orfil