A
Agamemnon
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
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