What's up everyone,
I have a very simple problem that hours of searching has not solved. I have a workbook with three sheets of data. I need to create a pivot table for each sheet of data, unique to each sheet of data. The first pivot table is being created just fine. The code stops working at the second table on the line where I am setting the pivot table variable = to the source cache. I currently keep getting an error about the field name but that shouldn't be a problem. I am receiving the following error:
There are no hidden rows or columns, each column heading is valid and there are no empty column headings. If I hit debut and then F8 to try and continue I get another error:
Run-time error '1004';
The PivotTable field name is not valid. To create a PivotTable report, you must use data that is organized as a list with labeled columns. If you are changing the name of a PivotTable field, you must type a new name for the field.
The below block of code is the exact same for pivot tables two and three, just replace ONE with TWO and THREE respectively. Again, the creation of the first table works fine but creation fails for the remaining two.
Run-time error '-2147417848 (800 10 108)':
Method 'CreatePivotTable' of object 'PivotCache' failed