VBA Pivot Table cannot enable multiple selections

ToniGo

New Member
Joined
Oct 2, 2013
Messages
25
Hello, I suspect this is a simple problem but for the life of me I don't know what is going wrong. I have a pivot table in another workbook, with cube source data. I get an error when trying to enable multiple selections.I got the Cube field names from recording a macro. If I manually enable when it debugs, then it works fine after that. Code is below I hope someone can help!

Code:
Workbooks.Open (Inbook)
Inbook = ActiveWorkbook.name
Set InSheet = ActiveWorkbook.ActiveSheet
InSheet.Activate

'******Error occurs here!!!!! Works if I enable manually when it debugs.....
ActiveSheet.PivotTables("PivotTable1").CubeFields(31).EnableMultiplePageItems = True
'*************
ActiveSheet.PivotTables("PivotTable1").PivotFields("[Project].[Region].[Region]").VisibleItemsList = RegArray()
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

Forum statistics

Threads
1,223,229
Messages
6,170,881
Members
452,364
Latest member
springate

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