Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
PFL
 
Posts: n/a
Default Pivot Table Refresh Problems

Hi All:
Hoping that someone can help. I am trying to refresh a pivot table
using the following code which was inserted on the Daily Production
Output Sheet(both sheets in the same workbook). I am using Excel 2003
Private Sub Worksheet_Calculate()


'If data on this worksheet changes, refresh the pivot table
Sheets("Daily Production
Output").PivotTables("PivotTable3").RefreshTable


End Sub


The Calculation has been set to Automatic.


However when I try to run the above code I am getting the following
error" Run Time error 1044, Application defined or Object defined
error". I think that the code worked a couple days ago.
PFL


What can I do to run the code ?
Thanks in advance

  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

My first guess is that the pivottable isn't named "pivottable3" (anymore).

If you rightclick on the pivottable and choose "table options" what do you see
in the "name" box?

If that's the only PT on that sheet, you could do:

Worksheets("daily production output").PivotTables(1).RefreshTable

(and never have to worry about the name again.)



PFL wrote:

Hi All:
Hoping that someone can help. I am trying to refresh a pivot table
using the following code which was inserted on the Daily Production
Output Sheet(both sheets in the same workbook). I am using Excel 2003
Private Sub Worksheet_Calculate()

'If data on this worksheet changes, refresh the pivot table
Sheets("Daily Production
Output").PivotTables("PivotTable3").RefreshTable

End Sub

The Calculation has been set to Automatic.

However when I try to run the above code I am getting the following
error" Run Time error 1044, Application defined or Object defined
error". I think that the code worked a couple days ago.
PFL

What can I do to run the code ?
Thanks in advance


--

Dave Peterson
  #3   Report Post  
Dave Peterson
 
Posts: n/a
Default

And if you have multiple pivottables on that sheet, you could do:

Dim PT As PivotTable
For Each PT In Worksheets("Daily Production Output").PivotTables
PT.RefreshTable
Next PT

or even get all the PT's in the whole workbook.

Me.Parent.RefreshAll

You may want to add

application.enableevents = false
'your code here
application.enableevents = true

If there's a chance that the calculation event could be called recursively.






PFL wrote:

Hi All:
Hoping that someone can help. I am trying to refresh a pivot table
using the following code which was inserted on the Daily Production
Output Sheet(both sheets in the same workbook). I am using Excel 2003
Private Sub Worksheet_Calculate()

'If data on this worksheet changes, refresh the pivot table
Sheets("Daily Production
Output").PivotTables("PivotTable3").RefreshTable

End Sub

The Calculation has been set to Automatic.

However when I try to run the above code I am getting the following
error" Run Time error 1044, Application defined or Object defined
error". I think that the code worked a couple days ago.
PFL

What can I do to run the code ?
Thanks in advance


--

Dave Peterson
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
I am having problems creating pivot table of data wyman Charts and Charting in Excel 1 January 12th 05 05:17 PM
Pivot Table Refresh Options PROVEXCEL Excel Discussion (Misc queries) 2 December 17th 04 12:33 PM
pivot table multi line chart souris Charts and Charting in Excel 2 December 7th 04 03:56 AM
convert excel list to pivot table GI Excel Discussion (Misc queries) 0 December 6th 04 06:45 PM
Pivot Table Data Refresh patemarie Excel Discussion (Misc queries) 1 December 1st 04 04:35 PM


All times are GMT +1. The time now is 05:20 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"