Runtime error 1004 with olap cube

Nicole D

New Member
Joined
Sep 1, 2016
Messages
1
I recorded a macro to select the month in my olap cube pivot table:

ActiveSheet.PivotTables("BY_TYPE").PivotFields( _
"[ACCIDENT YEAR TRIANGLE D].[Development AGE].[Development AGE]").CurrentPage _
= "[ACCIDENT YEAR TRIANGLE D].[Development AGE].&[9]"

I want to reference a cell that has the value I want to use. I called it CurrMonth. I changed the logic to this:

CurrMonth = Range("CurrMonth").Value
ActiveSheet.PivotTables("BY_TYPE").PivotFields( _
"[ACCIDENT YEAR TRIANGLE D].[Development AGE].[Development AGE]").CurrentPage _
= "[ACCIDENT YEAR TRIANGLE D].[Development AGE].&[" & CurrMonth & "]"

It is giving me the following error: Run-time error '1004': Unable to set the CurrentPage property of the Pivot Field class
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Did you ever figure out how to resolve this? I'm having the same issue right now.
 
Upvote 0

Forum statistics

Threads
1,221,826
Messages
6,162,192
Members
451,752
Latest member
majbizzaki

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top