Results 1 to 16 of 16

run-time error 1004 pivot table field name is not valid

Threaded View

  1. #1
    Registered User
    Join Date
    08-16-2018
    Location
    Asgard
    MS-Off Ver
    2013
    Posts
    8

    run-time error 1004 pivot table field name is not valid

    Hi all,

    I've encountered the error message (in title). I tried searching the web for a solution but with no luck.

    the code segment that receives the error:

    With ThisWorkbook
            .Sheets.Add(After:=.Sheets(.Sheets.count)).Name = "Load Port Pivot"
        End With
        
        Set pc = ThisWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:=LoadPort.Name & "!" & LoadPort.Range("A1").CurrentRegion.Address, Version:=xlPivotTableVersion15)
        Set pt = pc.CreatePivotTable(TableDestination:="'Load Port Pivot'!R1C1", TableName:="LPPivot", DefaultVersion:=xlPivotTableVersion15)
        
        pt.AddFields "ALARM TXT", "ENTITY", "SUB ENTITY"
        pt.AddDataField pt.PivotFields("ERROR COUNT"), , xlSum
        ActiveSheet.PivotTables("LoadPortPivot").TableStyle2 = "PivotStyleLight15"
    when the "set pt= ..." gets highlighted
    Last edited by OmerBD; 08-16-2018 at 04:36 AM. Reason: mistake

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Creating Pivot Table with VBA error 1004 Field not valid
    By JordtenBulte in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-10-2017, 10:38 PM
  2. excel run-time error 1004 pivot table field name is not valid
    By kentiq13 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-15-2016, 08:36 AM
  3. [SOLVED] So frustrated with this: "Run-time error '1004': The PivotTable field name is not valid"
    By vodka in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-14-2016, 11:16 AM
  4. Error 1004: PivotTable field name is not valid
    By pschris in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-07-2015, 11:27 PM
  5. Error 1004: PivotTable field name is not valid
    By pschris in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-25-2015, 09:38 AM
  6. VBA: Pivot Tables / Error 1004: Pivot Table Not Valid
    By vidyuthrajesh in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-22-2013, 03:54 PM
  7. pivot table refresh - error 1004 - reference is not valid
    By jrussell in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-14-2008, 05:08 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1