XL: GETPIVOTDATA Function Displays #REF! Error If External Reference Is Closed

Applies to: Microsoft Office Excel 2003Microsoft Office Excel 2007

Symptoms


When you create a GETPIVOTDATA function that refers to a PivotTable in another file that is closed, the function displays a #REF! error when you attempt to update the link.

Cause


The GETPIVOTDATA function is designed to work with a PivotTable in the same workbook as the function, or in another workbook that is open.

Workaround


To work around this issue, use either of the following methods:

  • Place the GETPIVOTDATA function in the same file as the PivotTable (in a blank area of the same sheet, or in another sheet), and then link the destination file to the appropriate cell.

    -or-
  • Make sure that the file that contains the PivotTable is open whenever you work with the linked file.