I’ve uploaded a test project to show this error. I’m loading an XLSX file with data where I haven’t called the
PivotCache.Refresh(), the pivot table has the correct numbers but I’ve lost my cell formatting (numbers with commas). The cell background color of the first row is not correct either; it has the same background color as the pivot table column headers.
After calling the
worksheet.Calculate(), my formulas based on the pivot table have invalid references because it looks like the pivot table doesn’t recognize row filters.
E.g. my formula
GETPIVOTDATA("Sum of CuLand",Pivot!$A$1,"CueType","Agricultural") has an invalid reference because the pivot table doesn’t recognize the row filter
Everything is corrected when I open the spreadsheet in excel and refresh all my data. Please fix this because I’m trying to print the last worksheet in the spreadsheet without asking my users to manually open the spreadsheet, refresh the data, and then print from Excel.
Here’s the link to my test project: