Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Pivottable problem


Hi,

I have the following strange situation at hand.

I have written some code in excel 2002 and want to compile it to excel
97. Everythings works fine except for one line of code

When I change a rowfield "Prod" to a "Pagefield" in a pivottable

- With ActiveSheet.PivotTables("Pivottable1").PivotFields ("Prod")
..Orientation = xlPageField
..Position = 1
End With-

the following line of code doesn't work anymore

-
ActiveSheet.PivotTables("PivotTable1").PivotFields ("PROD").CurrentPage
= "PROD1"-

and I get the following error

Runtime error "1004"
Unable to set the _default property of the PivotItem class.


If a run the code on a field that was already a pagefield I don't get
an error

If I record a new macro and simulate the action it records well the
following code
-
ActiveSheet.PivotTables("PivotTable1").PivotFields ("PROD").CurrentPage
= "PROD1"-
but I when I play the macro I get the same error.

It is as excel doesn't recognize the fact that I've changed the
pivottable layout.
Is someone familiar with this issue ?

Thx for your replies?

Aga


--
Agamemnon
------------------------------------------------------------------------
Agamemnon's Profile: http://www.excelforum.com/member.php...o&userid=23343
View this thread: http://www.excelforum.com/showthread...hreadid=380035

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Pivottable problem

Aga,

If I recall correctly, Excel 2000 was the first version with Pagefields.
They weren't part of the Excel 97 program. So to be backward compatible,
you won't be able to use pagefields.

HTH,
Bernie
MS Excel MVP


"Agamemnon" wrote
in message ...

Hi,

I have the following strange situation at hand.

I have written some code in excel 2002 and want to compile it to excel
97. Everythings works fine except for one line of code

When I change a rowfield "Prod" to a "Pagefield" in a pivottable

- With ActiveSheet.PivotTables("Pivottable1").PivotFields ("Prod")
Orientation = xlPageField
Position = 1
End With-

the following line of code doesn't work anymore

-
ActiveSheet.PivotTables("PivotTable1").PivotFields ("PROD").CurrentPage
= "PROD1"-

and I get the following error

Runtime error "1004"
Unable to set the _default property of the PivotItem class.


If a run the code on a field that was already a pagefield I don't get
an error

If I record a new macro and simulate the action it records well the
following code
-
ActiveSheet.PivotTables("PivotTable1").PivotFields ("PROD").CurrentPage
= "PROD1"-
but I when I play the macro I get the same error.

It is as excel doesn't recognize the fact that I've changed the
pivottable layout.
Is someone familiar with this issue ?

Thx for your replies?

Aga


--
Agamemnon
------------------------------------------------------------------------
Agamemnon's Profile:

http://www.excelforum.com/member.php...o&userid=23343
View this thread: http://www.excelforum.com/showthread...hreadid=380035



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
Problem with creating pivottable Ruben Excel Discussion (Misc queries) 0 August 27th 08 11:45 AM
PivotTable grouping problem septillion Excel Discussion (Misc queries) 0 July 4th 06 01:58 AM
Pivottable Problem mmwheeler Charts and Charting in Excel 1 August 4th 05 04:08 AM
PivotTable Problem stanshoe Excel Programming 2 March 11th 05 04:43 PM
VBA / Pivottable / showdetail - problem sihvonma Excel Programming 0 November 16th 04 10:15 AM


All times are GMT +1. The time now is 10:18 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"