+ Reply to Thread
Results 1 to 10 of 10

The PivotTable field name is not valid '-2147024809 (80070057)'

  1. #1
    Registered User
    Join Date
    03-29-2017
    Location
    Port Orange, FL
    MS-Off Ver
    MS 365
    Posts
    12

    The PivotTable field name is not valid '-2147024809 (80070057)'

    The following error message Just started occurring in my VBA script:

    Run-time error '-2147024809 (80070057)'

    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 the PivotTable field, you must type a new name for the field.

    The line of code which abends:
    Please Login or Register  to view this content.
    The source data has not changed. When recording the macro, the syntax is the same. When manually selecting PivotTable Analyze, Change Data Source, the process works FINE.

    Any help will be truly appreciated. Thank you!
    Last edited by 6StringJazzer; 06-30-2025 at 02:49 PM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2505
    Posts
    27,272

    Re: The PivotTable field name is not valid '-2147024809 (80070057)'

    Can you please attach your file and tell us what steps to take to reproduce the error? The problem may not be in the code but in the pivot table itself. I am puzzled by the error message because it does not include a PivotTable name field. Are you certain that's the right line of code?
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    03-29-2017
    Location
    Port Orange, FL
    MS-Off Ver
    MS 365
    Posts
    12

    Re: The PivotTable field name is not valid '-2147024809 (80070057)'

    The line of code where the error is occurring is right after these 2 lines of code:
    Sheets("LOCATION PIVOT").Select
    Range("A1").Select

    Are you able to see the attachment. The Module name is DNB_ HIM. In order for you to reproduce the error, you will need 2 additional files. The source file and a target file and you would have to modify my code in order to reproduce.

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,064

    Re: The PivotTable field name is not valid '-2147024809 (80070057)'

    You didn't attach a file.

    How is PivotRange declared (as Range or as String?) and set?
    Everyone who confuses correlation and causation ends up dead.

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2505
    Posts
    27,272

    Re: The PivotTable field name is not valid '-2147024809 (80070057)'

    To attach a file, use the Paper Clip icon and follow instructions, or use this method:

    1. Under the text box where you type your reply click the Go Advanced button.
    2. On the next screen scroll down and under the Attachments section click the Manage Attachments link, which will show a pop-up window.
    3. Click the Choose File button to select a file to attached.
    4. Click the Upload button to upload the file.
    5. Then click the Close This Window button. Your file is now attached to your post.

  6. #6
    Registered User
    Join Date
    03-29-2017
    Location
    Port Orange, FL
    MS-Off Ver
    MS 365
    Posts
    12

    Re: The PivotTable field name is not valid '-2147024809 (80070057)'

    Code for PivotRange is:

    PivotRange = "EPIC DNB RAW DATA " & ReStrFileDate_Dash & "!R2C1:R" & TrgLastRow_incl_header & "C27"


    but I do NOT set it as either string or range, defaults to Variant/String as illustrated in LOCAL window.

    : PivotRange : "EPIC DNB RAW DATA 06-30-2025!R2C1:R13085C27" : Variant/String

    ReStrFile_Dash and TrgLastRow_incl_Header vary week to week

    The attachment should be able now.

    I truly appreciate your help with this once. It's been driving me NUTS!
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    03-29-2017
    Location
    Port Orange, FL
    MS-Off Ver
    MS 365
    Posts
    12

    Re: The PivotTable field name is not valid '-2147024809 (80070057)'

    I'm providing you a copy of the TEMPLATE file as well entitled:

    EPIC DNB RAW DATA TEMPLATE.xlsx

    I actually rebuilt the PIVOTTABLE on tab entitled LOCATION PIVOT. Reran my process but got the same error message. Could MS have done a batch update which could have possible affected this?

    Thank You!
    Attached Files Attached Files

  8. #8
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,064

    Re: The PivotTable field name is not valid '-2147024809 (80070057)'

    The problem is that you should have single quotes around the sheet name as it has spaces in it, and a recent update is much less forgiving of that than previously:

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    03-29-2017
    Location
    Port Orange, FL
    MS-Off Ver
    MS 365
    Posts
    12

    Re: The PivotTable field name is not valid '-2147024809 (80070057)'

    That worked!!!!

    I can't say "THANK YOU" enough for resolving this. I'll keep that in mind.

    Thank you again and I truly appreciate the assistance everyone who contributed.

  10. #10
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,064

    Re: The PivotTable field name is not valid '-2147024809 (80070057)'

    Glad we could help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Run-time error'-2147024809(80070057)
    By sunboy in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 05-07-2024, 01:10 PM
  2. Run Time Error -2147024809 (80070057)
    By jptierney in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-08-2021, 06:44 AM
  3. Run Time Error -2147024809 (80070057)
    By mtouhid in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-03-2020, 04:34 PM
  4. Run-time error '-2147024809 (80070057)
    By RJ1969 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-02-2017, 06:06 AM
  5. msoTextOrientationVertical gives Runtime error 2147024809 80070057
    By vba-dar in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-11-2015, 08:56 PM
  6. [SOLVED] Run Time Error -2147024809 (80070057)
    By shiftyspina in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-19-2014, 11:51 AM
  7. [SOLVED] Run-Time Error '-2147024809 (80070057)': Could not find the specified object
    By eemiller1997 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-04-2013, 12:44 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