My pivot table refuses to refresh unless I do it manually

rizzo93

Active Member
Joined
Jan 22, 2015
Messages
295
Office Version
  1. 365
My pivot table isn't refreshing when I tell it to.

Worksheet 1
This sheet has a connection to a SharePoint list.

Worksheet 2
This sheet has a table that is similar to Worksheet 1, but has additional columns for calculations. This table is then used as my source for the pivot table, which is stored on another worksheet. I'm not sure if it makes a difference, but Worksheet 2 is "very hidden" because I don't won't users messing with it.

When I add a record to my SharePoint list and execute my code to refresh everything, the connection on Worksheet 1 and table on Worksheet 2 are updated, but the pivot table doesn't care.

This is the code I'm using:
VBA Code:
Dim alphabook As Workbook
Set alphabook = ThisWorkbook
alphabook.Connections("Intake for Reporting").Refresh
Worksheets("Dashboard").PivotTables("PivotTable1").PivotCache.Refresh

I've also tried ThisWorkbook.RefreshAll, which still doesn't refresh the pivot table.

What am I missing, please?
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

Forum statistics

Threads
1,213,510
Messages
6,114,037
Members
448,543
Latest member
MartinLarkin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top