I need to create Excel pivot table from within my vb app
Here is a relevant piece of code:
Dim pc As PivotCache
Set pc = oWBook.PivotCaches.Add(xlExternal)
Set .Recordset = rstRecordset ' <-Got error 1004 - Application-defined or object-defined error
rstRecordset at that moment is open and contains all requested data.
What am I doing wrong?