PC Review


Reply
Thread Tools Rate Thread

Create a pivot table with a local connection

 
 
=?Utf-8?B?Tmly?=
Guest
Posts: n/a
 
      12th Mar 2007
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:=xlExternal)
.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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 - Create Pivot table from another pivot table =?Utf-8?B?VG9tIEJlcmdtYW4=?= Microsoft Excel Discussion 5 17th Nov 2007 12:51 AM
how to create pivot table from existing pivot table in excel 2007 =?Utf-8?B?VWRheXJhaiBEaHVsZWthcg==?= Microsoft Excel Misc 1 15th Dec 2006 04:23 AM
How do I create multiple pivot charts from one pivot table? =?Utf-8?B?UnVkeQ==?= Microsoft Excel Charting 1 17th Mar 2006 10:01 PM
How do I create a pivot table if the pivot table icon or menu ite. =?Utf-8?B?THlubkBXUw==?= Microsoft Excel Charting 1 16th Dec 2004 02:36 AM
pivot table: create worksheetsheet using pivot table =?Utf-8?B?QnVk?= Microsoft Excel Misc 0 16th Sep 2004 06:41 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:31 AM.