Code:
Function PivotRefreshDate(CellWithinPivot As Range)
PivotRefreshDate = CellWithinPivot.PivotTable.RefreshDate
End Function
Code:
With wbkPivots
.Sheets("General").PivotTables("PvtSCF").PivotCache.Refresh
.Save
.Close SaveChanges:=True
End With
If I re-open the workbook, select the cell with the UDF, press F2, press enter. Then it calculates perfectly.
Gavin