0 Replies - 3251 Views - Last Post: 29 July 2008 - 01:28 PM Rate Topic: -----

#1 Dabbler  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 28-July 08

PivotTable refresh code gives run-time error '1004'

Post icon  Posted 29 July 2008 - 01:28 PM


I am using this code - ActiveSheet.PivotTables("PivotTable2").PivotCache.Refresh in an attempt to refresh a pivot based off an external data source in Excel but every time I run it I get a Run-time error '1004': Application-defined or object-defined error.

I tried simply recording a macro but when I do the macro looks like this

Sub Macro8()
' Macro8 Macro

End Sub

I think it's because the pivot is based off an external query. What I am trying to do is to have an update pivot macro attached to a button that updates the pivot once the data has been updated which is tied to a parameter query.

I have googled this to death and cannot find an answer.

Thanks for any suggestions.

Is This A Good Question/Topic? 0
  • +

Page 1 of 1