ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Re-Linking Pivot tables to MS Query (https://www.excelbanter.com/excel-programming/389636-re-linking-pivot-tables-ms-query.html)

JohnB

Re-Linking Pivot tables to MS Query
 
Advice needed: I have 2 MS Access dbs 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 PTs to
MS Query.

TIA
Johnb

Tom Ogilvy

Re-Linking Pivot tables to MS Query
 
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.

--
Regards,
Tom Ogilvy


"johnb" wrote:

Advice needed: I have 2 MS Access dbs 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 PTs to
MS Query.

TIA
Johnb


JohnB

Re-Linking Pivot tables to MS Query
 
Hi Tom,

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

johnb

"Tom Ogilvy" wrote:

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.

--
Regards,
Tom Ogilvy


"johnb" wrote:

Advice needed: I have 2 MS Access dbs 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 PTs to
MS Query.

TIA
Johnb



All times are GMT +1. The time now is 08:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com