LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Nir Nir is offline
external usenet poster
 
Posts: 36
Default Create a pivot table with a local connection

Hi,

On Excel 2003 SP2:
I'm trying to create a pivot table with a pivot cache connected to a local
cube file as follows:

Sub Macro1()
With ActiveWorkbook.PivotCaches.Add(SourceType:=xlExter nal)
.LocalConnection = "OLEDB;Provider=MSOLAP;Data Source=C:\Documents
and Settings\nir.zamir\Desktop\Basic Metrics.cub"
.UseLocalConnection = True
.CommandType = xlCmdCube
.CommandText = Array("AdvertisingDataMain")
.MaintainConnection = True
.CreatePivotTable TableDestination:="[Book1]Sheet1!R3C1",
TableName:= _
"PivotTable1", DefaultVersion:=xlPivotTableVersion10
End With
End Sub

However, the UseLocalConnection line throws an error (run time error 1004 -
application-defined or object-defined error).

What could be the reason?

Thanks,
Nir
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Affect a new connection to a pivot table Philippe Cand Excel Discussion (Misc queries) 0 March 17th 10 08:49 PM
Excel 2007 - Local Cube - Pivot Table Minas Papageorgiou Excel Discussion (Misc queries) 0 October 31st 09 10:32 PM
I would lke to create a league table for my local dart team mauricemarron Excel Discussion (Misc queries) 3 October 14th 09 03:53 PM
Copy pivot table and get rid of connection araki Excel Discussion (Misc queries) 3 March 8th 06 12:59 AM
Pivot Table Connection Steven Taylor[_3_] Excel Programming 5 November 19th 03 02:40 PM


All times are GMT +1. The time now is 09:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"