Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default PivotCache.refresh not working

Hi,

In one of the macros, i am trying to update the connection properties
at workbook_open event but getting error "Application-Defined or
Object-Defined error" when code comes to pt.PivotCache.Refresh. Below
is the code:

Public Sub updateProperties()
Dim sh As Worksheet, qy As QueryTable
Dim pt As PivotTable, pc As PivotCache
Dim OldPath As String, NewPath As String
NewPath = Sheets("Instructions").Range("C130")

For Each pt In ws.PivotTables
pt.PivotCache.Connection = _
Application.Substitute(LCase(pt.PivotCache.Connect ion),
_
LCase(pt.PivotCache.Connection), LCase(NewPath))
pt.PivotCache.Refresh
Next pt
Next ws
End Sub

I have searched for a solution without any luck. Please help.

Thanks,
Navin
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
RefreshTable vs PivotCache.Refresh moorey Excel Programming 2 June 1st 09 02:31 AM
Can I Turn PivotCache Refresh (Calc) off & on in VBA? MikeZz Excel Programming 0 February 4th 09 09:29 PM
PivotCache.Refresh Paul Dennis Excel Programming 3 November 8th 07 12:40 AM
Background refresh not working GorKo Excel Programming 1 July 25th 07 06:00 AM
RefreshTable vs PivotCache.Refresh Paul Lautman Excel Programming 0 September 24th 04 04:17 PM


All times are GMT +1. The time now is 12:25 AM.

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"