Glory
Well-known Member
- Joined
- Mar 16, 2011
- Messages
- 640
Code:
Dim a As PivotCache
Set a = ThisWorkbook.PivotCaches.Add _
(SourceType:=xlDatabase, _
SourceData:=Sheets("Sheet1").Range("A:J"))
'MsgBox a.Index
ThisWorkbook.Sheets("Table6").PivotTables(1).CacheIndex = a.Index
The index of "a" is "0", even though I can .Count five other caches in my workbook. I receive "Application or object-defined error" when the CacheIndex of the existing table is let to match the index of "a".