LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default PivotCaches.add Difficulties

Using Excel 2003:

The following code works correctly:

Sub Build_Pivot_Cache
Dim CurrWkbk as Workbook
Set CurrWkbk = Activeworkbook.Name
CurrWkbk.PivotCaches.Add(SourceType:=xlDatabase, SourceData:=
_
"CombinedData!Database").CreatePivotTable TableDestination:= _
"InvoicePivot!R2C1", TableName:="Invoice_Pivot_Table", _
DefaultVersion:=xlPivotTableVersion10
End Sub


The following code gives me Run time error '438' - Object doesn't
support this property of method on the pivotcaches.add line.

Sub Build_Pivot_Cache
Dim CurrWkbk As Workbook
Set CurrWkbk = ActiveWorkbook
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase,
SourceData:= _
"CombinedData!Database").CreatePivotTable TableDestination:= _
"[" & CurrWkbk & "]InvoicePivot!R2C1",
TableName:="Invoice_Pivot_Table", _
DefaultVersion:=xlPivotTableVersion10
End Sub

Why does it do this when i try to fully qualify the SourceData?

the only difference in the above is that i am setting CurrWkbk =
Activeworkbook and calling that instead
 
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
refer to current file name in PivotCaches.Add jo Excel Programming 1 April 1st 07 12:10 AM
Pivotcaches add method TomD Excel Programming 1 March 10th 06 08:58 AM
PivotCaches.Add jacob Excel Programming 2 February 5th 04 08:58 AM
change commandtext in pivotcaches patrick Excel Programming 3 September 2nd 03 03:06 PM


All times are GMT +1. The time now is 06:38 AM.

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"