Hello,
I've put together a macro that creates a pivot table and adds pivotfields depending on the value of a variable. The fields to add are stored in an array, along with the values for the orientation propery (or at least, that's the idea).

The first part of the macro works fine and it has worked prior to me adding the values for the orientation property, leading me to think that it's the values in the array that are the problem. However, i can't figure out how to resolve the issue. Each time the line that sets the orientation I get the message in the Title of this thread.

I'd like to keep using the variables and arrays if i can because this is part of a bigger project in which it's likely that this code will be used in a similar way with parameters being passed to it.

Here is an extract from the code (please let me know if any additional info would be helpful - this is my first post and I'm a relative beginner to VBA!). Thanks in advance for your help...

Please Login or Register  to view this content.