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

I have the following statements in a script to update an existing Pivot
Table. They work fine as long as the Access database that is used as the
source is in the same location/path as when the Pivot Table was originally
created. My problem is that I am developing this for another user and the
location/path of the Access database will be different than that for my work.

I was under the impression that if I included the statement prior to the
"Refresh" that it would cause the refresh to point to a different location
and/or name of the Access dataabase. This does not seem to be working.

Is there a way to change the location and/or name of the external file that
the pivot table is pulling the data from? Or am I missing something obvious?

Thanks.

With ActiveWorkbook.PivotCaches.Add(SourceType:=xlExter nal)
.Connection = Array(Array(ConnText1), Array(ConnText2))
.CommandType = xlCmdSql
.CommandText = Array(CommText1, Commtext2)
End With
ActiveSheet.PivotTables("QUARTERVOLUME").PivotCach e.Refresh


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 336
Default Pivot Table Refresh

I think I may have found the answer. My solution appears to work, but I have
not tested this with another user (yet). We'll see.

Here is the new refresh statement that seems to work.

With ActiveSheet.PivotTables("QUARTERVOLUME").PivotCach e
.Connection = Array(Array(ConnText1), Array(ConnText2))
.CommandType = xlCmdSql
.CommandText = Array(CommText1, Commtext2)
.Refresh
End With



"Martin" wrote:

I have the following statements in a script to update an existing Pivot
Table. They work fine as long as the Access database that is used as the
source is in the same location/path as when the Pivot Table was originally
created. My problem is that I am developing this for another user and the
location/path of the Access database will be different than that for my work.

I was under the impression that if I included the statement prior to the
"Refresh" that it would cause the refresh to point to a different location
and/or name of the Access dataabase. This does not seem to be working.

Is there a way to change the location and/or name of the external file that
the pivot table is pulling the data from? Or am I missing something obvious?

Thanks.

With ActiveWorkbook.PivotCaches.Add(SourceType:=xlExter nal)
.Connection = Array(Array(ConnText1), Array(ConnText2))
.CommandType = xlCmdSql
.CommandText = Array(CommText1, Commtext2)
End With
ActiveSheet.PivotTables("QUARTERVOLUME").PivotCach e.Refresh


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
slow document / pivot table refresh and pivot function Justin Larson[_2_] Excel Discussion (Misc queries) 1 April 2nd 09 06:41 PM
Create refresh button in worksheet to refresh Pivot Table Data Ron Excel Worksheet Functions 1 October 13th 07 01:20 AM
refresh a new worsheet on pivot table refresh [email protected] Excel Worksheet Functions 0 February 9th 07 07:39 PM
Timing of automatic query refresh and macro pivot table refresh dutty Excel Programming 2 December 1st 04 07:19 PM
Pivot Table REFRESH Flaw -- Saves Old Data in Selection Area AFTER REFRESH Ken Roberts Excel Programming 3 September 11th 03 06:02 AM


All times are GMT +1. The time now is 02:53 AM.

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

About Us

"It's about Microsoft Excel"