View pivot table external data source in Excel 2007

M

Marc Forget

I'm trying to just view the current external data source of an Excel pivot
table. I can find the path to the Access database and the name of the
database, but I can't find the name of the table or query which actually
forms the basis for the pivot table.

From reading prior posts, I tried using the VBA command
MsgBox ActiveWorkbook.PivotCaches(1).SourceDataFile (or CommandText)
but this just tells me the path and database name again, not the table/query
name.

Is there a way to get this information?

Thank you.
 
I

iliace

Go to the Data tab, and click on Connections. Find the connection
you're looking for, click Properties, go over to the Definition tab,
and look in the Command Text box.
 
M

Marc Forget

Thanks. I actually found it through the PivotTable Tools Options tab by
clicking on Change Data Source and Connection Properties. Your suggestion
works also, but if there are many connections on the workbook, it may not be
obvious which connection to look for.
 
I

iliace

I like to give connections meaningful names, so that I can distinguish
them. But you're right, it can get quite confusing!
 
M

Marc Forget

I'll try to encourage my co-workers to use meaningful connection names also!

Thanks again.
 

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