Refresh of pivot tables

M

Mick Wilcox

Hi
I have a spreadsheet that uses MS Query to refresh several pages from an SQL
Server Help Desk database. This works fine - all queries are set to refresh
on open. I also have pivot tables on a separate sheets based on each
resultant page. Even though the pivots are set to auto refresh they don't
(or I suspect they refresh on open from 'old' data on the still refreshing
database linked pages. Any ideas for making the pivot tables wait until the
data's changed before refreshing?

Mick
 
D

Dale Hymel

I think links are refreshed when an file is open, prior to the
ThisWorkbook's Workbook Open event.

So you can include the following in that event:

Private Sub Workbook_Open()
ActiveSheet.PivotTables("PivotTable1").RefreshTable
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top