Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Pivot Table Datasource

I have a pivot table link to a query in a MAccess
database. Took me a long time to format the report...
Now, when I move the excel file on the server with the
database, the pivot table still point to the one on my C:
drive. How can I change the datasource without creating
a new pivot table and reformating?

even when I reassign a
new "ActiveWorkbook.PivotCaches.Connection" string, and
refresh, doesn't seem to work.

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default Pivot Table Datasource

Charles,

There are two changes that need to be made to reference a different external
Access database file.

(1) ActiveWorkbook.PivotCaches(1).Connection =
"your_modified_connection_string"
(2) ActiveWorkbook.PivotCaches(1).CommandText =
"your_modified_commandtext_string"
(Important: You must change them in this order)

The SQL CommandText string will have embedded in the FROM clause the
filepath to the Access database, so it isn't sufficient to just change the
connection string. Note, in this simple example I've assumed the PivotCache
is Item 1. You will need to reference your PivotCache appropriately. Hope
this helps.

Troy

"Charles" wrote in message
...
I have a pivot table link to a query in a MAccess
database. Took me a long time to format the report...
Now, when I move the excel file on the server with the
database, the pivot table still point to the one on my C:
drive. How can I change the datasource without creating
a new pivot table and reformating?

even when I reassign a
new "ActiveWorkbook.PivotCaches.Connection" string, and
refresh, doesn't seem to work.

Thanks!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pivot Table with MS Access as DataSource PiB311 Excel Discussion (Misc queries) 1 June 2nd 10 08:48 PM
datasource from stored procedure to pivot table rodchar Excel Discussion (Misc queries) 0 March 23rd 09 10:45 PM
determine in datasource or pivot table rodchar Excel Discussion (Misc queries) 0 March 23rd 09 05:34 PM
Pivot Tables -changing datasource for exsting Pivot Table kfschaefer Setting up and Configuration of Excel 0 May 30th 06 06:36 PM
Pivot Table - identifying datasource halemweg Excel Discussion (Misc queries) 1 July 1st 05 07:03 PM


All times are GMT +1. The time now is 11:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"