View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
dzeaman dzeaman is offline
external usenet poster
 
Posts: 1
Default Creating local cube using PivotTable

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?