create offline .cub file in vba

Stampe

New Member
Joined
Nov 15, 2021
Messages
1
Office Version
  1. 365
Hi

I have a solution where I use a SSAS olap cube as data source with a pivot table as front-end, some users need to have a offline .cub file, and I can create this file manually with out issues, but I can't figure out how to create a function wich will do the same.

I'm using this code :

Sub UseCreateCubeFile()
ActiveSheet.PivotTables("Pivottabel1").CreateCubeFile _
File:="C:\Data\CustomCubeFile.cub", Properties:=False
End Sub

But I keep geting an error (1004) telling me that object is not defined, I've tried to create a Pivot table object but still no luck

I can't find much documentation regarding this, has anyone succeded with this ?

br

Peter
 

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,215,403
Messages
6,124,710
Members
449,182
Latest member
mrlanc20

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