EnableItemSelction on Page Field in 2003 VBA not working

J

JM

When scripting pivot table in Excel 2003, I am trying to set
enableitemselection to false on a field in the page field area. When the
same field is located in a row or column, the code below works fine, but if I
try to specify a pagefield, I get a runtime error 1004. Have also tried to
use a for loop with just pt.PivotFields, similar to below, but get the same
error when a page field is present in the pivot table. Is there some
difference in syntax for pagefield?

Thanks for any help : )

Code Works, but not with Pagefields:

Dim pt As PivotTable
Dim pf As PivotField
Set pt = ActiveSheet.PivotTables(1)
For Each pf In pt.RowFields
pf.EnableItemSelection = False
Next
For Each pf In pt.ColumnFields
pf.EnableItemSelection = False
Next
 
J

JM

Thanks, Debra. Yes, it is an OLAP source. It is working for row and column
fields, just page field that is not working. Setting works for fields when
they are in row/col positions on pivot table, but not when I move them into
page. Is this a documented issue with 2003?

Thanks in advance.

J
 
J

JM

Debra, or anyone interested, can you please verify that this property can be
set programatically on a page field using an OLAP data source without
errors? I can see the property in a watch window using the debugger. Any
help is apprciated : ))

~ JM
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top