sheppard26
New Member
- Joined
- Sep 8, 2009
- Messages
- 20
Hi,
I am trying to set the PivotCache SourceData to a value,which is a filename/path, in a specific cell within the workbook.
I have written the following code but receive a runtime error 438 when running it.
Dim Source As String
Dim PTCache As PivotCache
Source = ActiveWorkbook.Sheets("Macros").Range("B7").Value
Set PTCache = ActiveWorkbook.PivotCaches.create( _
SourceType:=xlDatabase, _
SourceData:=Source)
'Refresh Pivot Cache
Sheets("Spot Sales").PivotTables("Endur Source").PivotCache.Refresh
This Cache is specific to one of many pivottable within the workbook, I have not specified that this cache is relating to this pivottable, could this be the problem? All the other pivot tables are linked to this pivot in question.
I hope this makes sense.
PLEASE PLEASE help, this is driving me nuts!
I am trying to set the PivotCache SourceData to a value,which is a filename/path, in a specific cell within the workbook.
I have written the following code but receive a runtime error 438 when running it.
Dim Source As String
Dim PTCache As PivotCache
Source = ActiveWorkbook.Sheets("Macros").Range("B7").Value
Set PTCache = ActiveWorkbook.PivotCaches.create( _
SourceType:=xlDatabase, _
SourceData:=Source)
'Refresh Pivot Cache
Sheets("Spot Sales").PivotTables("Endur Source").PivotCache.Refresh
This Cache is specific to one of many pivottable within the workbook, I have not specified that this cache is relating to this pivottable, could this be the problem? All the other pivot tables are linked to this pivot in question.
I hope this makes sense.
PLEASE PLEASE help, this is driving me nuts!
Last edited: