I'm having a Pivot table in a sheet and I want to set a PivotField at a predefined value when that value exists in the fields list.

The following code works fine but gives an error (Run-time error '1004': Unable to get the PivotTables property of the Worksheet class) when the predefined value does not exists in the fields list...

How can I transform this into a if-else construction where I check the presence of the predefined value first? (If predefined value isn't available then the option '(blank)' should be selected.)

ActiveSheet.PivotTables("PivotCC").PivotFields("Customerspecs"). _
     CurrentPage = "CC missing"