Name

pivottable.SourceData

Synopsis

Returns the data source for the pivot table. The information returned depends on the SourceType set when the pivot table was created, as described in the following table.

SourceType

SourceData returns

xlDatabase

The address of the source range.

xlExternal

An array containing the database connection string and SQL query string divided into 255-character elements.

xlConsolidation

A two-dimensional array. Each row consists of a reference and its associated page field items.

xlPivotTable

One of the preceding kinds of information.

You can find a pivot table’s SourceType by checking the SourceType property of the underlying PivotCache object.

Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.