My pivot table refuses to refresh unless I do it manually

rizzo93

Active Member
Joined
Jan 22, 2015
Messages
250
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?
 

Some videos you may like

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

Watch MrExcel Video

Forum statistics

Threads
1,114,581
Messages
5,548,874
Members
410,881
Latest member
toonces
Top