Re-Linking Pivot tables to MS Query

J

johnb

Advice needed: I have 2 MS Access db’s which are the data source for 2 Excel
workbooks. These workbooks contain about 30 pivot tables in each book. Each
pivot table is linked via MSQuery to an Access query. These pivot table links
are hard coded behind the scenes. How can I use VBA to re-link these PT’s to
MS Query.

TIA
Johnb
 
T

Tom Ogilvy

Look at the connection property of the the PivotCache Object. Look at what
the current value is then make the changes to that string and reassign it.
There is also a hidden SQL property that you might want to look at.
 
J

johnb

Hi Tom,

Thank you for the comment. The hidden SQL property, is it found under
..CommandType = xlCmdSql ??

johnb
 

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