Reputation: 13
This macro has been failing to run due to "Run-time error '1004'"
It states that '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 code that needs to be debugged is as follows:
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Sheet3R1C1:R671905C15", _
Version:=xlPivotTableVersion14).CreatePivotTable _
TableDestination:="Sheet4!R3C1", TableName:="PivotTable1", _
DefaultVersion:=xlPivotTableVersion14
Any suggestions or solutions would be much appreciated. Thank you very much!
Upvotes: 1
Views: 310
Reputation: 16
Because of the error mesage it could be that the database you are trying to read and bring into a Pivot Table has one or more columns without a name/label. Make sure all columns you are using have some data on the first row.
Upvotes: 0