Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GETPIVOTDATA in Excel 2003 doesn't update

Status
Not open for further replies.

teddybear0677

Programmer
May 19, 2005
5
0
0
AU
Hi,
Not sure if this is the right place for this or not.

I have an Excel 2000 workbook with several pivot tables in it. They are all linked to an Access 2000 database.
On another sheet I have a GETPIVOTDATA formula, this formula works fine in Excel 2000 but in Excel 2003, it shows only the total of all the cells (total from pivot table) that I use for the GETPIVOTDATA statement.

If I automate it using .REFRESH for the pivot table, it doesn't change the GETPIVOTDATA results although it does when I manually go and click on the pivottable and click on the refresh data icon.

Any suggestions how or why the Data is not changing in Excel 2003??? Hope this makes sense.
 
Are you sure that your code is refreshing the the same table as you do manualy?

I.E.
PivotTable(1)

'Here's an alternate to try, if this works then the code is pointing an incorrect table definition.

Sub update_pivots_all()
For Each pt In ThisWorkbook.PivotTables
pt.RefreshTable
Next
End Sub
 
Check the help files. I think I remember seeing a syntax difference in the getpivotdata function between 2000 and 2003 (I'm not sure because I haven't actually used the funnction)
 
Thanks everyone for their help. Turns out you need to reference the field even if there is only one column in the pivottable otherwise it picks up the total from the bottom. have fixed it now. Thanks muchly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top