Creating local cube using PivotTable

D

dzeaman

I tried to write a macro while creating a local cube, and Excel wrote this
VB-code:
With ActiveSheet.PivotTables("Table1").PivotCache
..LocalConnection = _
"OLEDB;Provider=MSOLAP;Data Source=C:\test.cub;Initial Catalog=Test"
..UseLocalConnection = True
End With

But when I tried to execute this macro, there was an "Application defined or
object defined error". The cube was created but had no data.

First question: why?

Second question: if I will not create a microcube using this method, what
can I do to create a local cube in VBA from existing PivotTable?
 
Top