Documenting external query for PivotTables

P

paperboy21

I am trying to write a macro that will document the connection string and
SQL code used to pull external data into my PivotTables. I know that the
information I want is in the SourceData property in each of my PivotTables.
Problem is, sometimes I have multiple PivotTables in a file that "link" back
against a source PivotTable (i.e. Right click in the pivot table and select
PivotTable Wizard... Click the < Back button... Click the next < Back
button... Select the "Another PivotTable report or PivotChart report" radio
button and click Next >... Select the pivot table containing the same data
and click Finish).
I don't want to document the same SQL code over and over again. If my
Excel file has just a single "master" query, then that's all I want to
document (on the other hand, if each PivotTable in my file is, indeed,
different, then I want to see them individually). I can't seem to find how
to tell if the data in any given PivotTable is obtained directly from the SQL
statement, or whether it comes from a "master" PivotTable.

TIA,
Tim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top