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:
I've also tried ThisWorkbook.RefreshAll, which still doesn't refresh the pivot table.
What am I missing, please?
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?