Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default EnableItemSelction on Page Field in 2003 VBA not working

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,979
Default EnableItemSelction on Page Field in 2003 VBA not working

If you're using an OLAP source, this seems to be broken in Excel 2003,
although it's been fixed in Excel 2002 in SP3:

List of issues in Excel 2002 that are fixed by Office XP Service Pack 3
http://support.microsoft.com/default...b;en-us;836031


JM wrote:
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




--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default EnableItemSelction on Page Field in 2003 VBA not working

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

"Debra Dalgleish" wrote:

If you're using an OLAP source, this seems to be broken in Excel 2003,
although it's been fixed in Excel 2002 in SP3:

List of issues in Excel 2002 that are fixed by Office XP Service Pack 3
http://support.microsoft.com/default...b;en-us;836031


JM wrote:
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




--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,979
Default EnableItemSelction on Page Field in 2003 VBA not working

I don't see any documentation on the problem for Excel 2003.

JM wrote:
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

"Debra Dalgleish" wrote:


If you're using an OLAP source, this seems to be broken in Excel 2003,
although it's been fixed in Excel 2002 in SP3:

List of issues in Excel 2002 that are fixed by Office XP Service Pack 3
http://support.microsoft.com/default...b;en-us;836031


JM wrote:

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




--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html





--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default EnableItemSelction on Page Field in 2003 VBA not working

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

"Debra Dalgleish" wrote:

I don't see any documentation on the problem for Excel 2003.

JM wrote:
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

"Debra Dalgleish" wrote:


If you're using an OLAP source, this seems to be broken in Excel 2003,
although it's been fixed in Excel 2002 in SP3:

List of issues in Excel 2002 that are fixed by Office XP Service Pack 3
http://support.microsoft.com/default...b;en-us;836031


JM wrote:

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




--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html





--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Working Around 240 Character PRN Field Width Limit Confused_in_Houston[_2_] Excel Discussion (Misc queries) 1 January 20th 10 09:25 PM
Show Field List in Pivot not working RSolti Excel Discussion (Misc queries) 6 June 18th 08 01:19 PM
Calculated Field Total formula not working snigam Excel Worksheet Functions 0 June 13th 07 03:42 PM
Cursor doesn't move when page up or page down in Excel 2003 christiandad Excel Discussion (Misc queries) 3 December 12th 05 04:01 PM
Convert 20050118 to a working date field Jessica Excel Worksheet Functions 7 February 23rd 05 10:07 PM


All times are GMT +1. The time now is 11:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"