• Pivot table addfields error (Excel 2000)

    Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » Pivot table addfields error (Excel 2000)

    Author
    Topic
    #396383

    Hello,

    I’m not very good with pivot tables (one of my ‘strong weaknesses’ in Excel), so I can’t make out the following error message. I received a file from Poland which included a macro – among others – to create a pivot table. I ran the macro, however that stopped at the addfields…line. I’ve been searching in the Help file, on the internet/newsgroups, but I have only found 3 mentions of this error, and none with a real solution at hand.
    Here is the part of the macro that doesn’t run. From the Help I gathered that the syntax should be ok, so I’m lost!!!
    Please help if possible.

    Thanks,
    K.

    ActiveSheet.PivotTableWizard TableDestination:=ActiveSheet.Cells(3, 1)
    ActiveSheet.Cells(3, 1).Select
    ActiveSheet.PivotTables(“Tabela przestawna1”).SmallGrid = False
    ActiveSheet.PivotTables(“Tabela przestawna1″).AddFields RowFields:=”Dane”, _
    ColumnFields:=”group”

    The problem is at the very last line where ‘Addfields’ in included.

    Viewing 1 reply thread
    Author
    Replies
    • #742406

      I bet that “Tabela przestawna1” is Polish for “Pivot table1”. If you run the macro on an English-language system, your pivot table won’t be called “Tabela przestawna1”, of course. To be independent of the language, use PivotTables(1) instead of PivotTables(“Tabela przestawna1”), assuming that you have only one pivot table on the worksheet.
      Additionally, “Dane” and “Group” must be column headings in the source data for the pivot table.

      • #742433

        I changed the name, but it still didn’t work. The only way it actually ‘did something’ was when I took out the ‘Dane’ as in RowFields:=”Dane”. However it stopped working as soon as it hit a next occurance of ‘Dane’, which in this case was (copied from the original macro): ActiveSheet.PivotTables(“Tabela przestawna1”).PivotFields(“Dane”).PivotItems( _
        “Maksimum: ZUNI”).Position = 1

        I checked in the raw data and I had a column heading called ‘groups’ but Dane didn’t exist in the raw table at all. I have no idea what it is actually.
        Nevertheless, I got a copy of the file that my colleauge succesfully ran in Poland, and this is how the Dane is displayed in his report (see attached file).
        Any further ideas on how to solve this?
        Thanks in advance!
        K.

        • #742469

          This is one of the areas where internationalization horribly fails. While formulas are stored in a symbolic form, so that they will work in any version of Excel, pivot tables use localized names, so they will only work correctly in the version for the language they were created in. As you might guess, “Maksimum” is “maximum”, and I think that “Dane” is Polish for “data”.

          I fear that you will keep on running into this problem. It will probably be easier to ask for an explanation of what the pivot table is supposed to do, and then reconstruct it yourself.

        • #742470

          This is one of the areas where internationalization horribly fails. While formulas are stored in a symbolic form, so that they will work in any version of Excel, pivot tables use localized names, so they will only work correctly in the version for the language they were created in. As you might guess, “Maksimum” is “maximum”, and I think that “Dane” is Polish for “data”.

          I fear that you will keep on running into this problem. It will probably be easier to ask for an explanation of what the pivot table is supposed to do, and then reconstruct it yourself.

      • #742434

        I changed the name, but it still didn’t work. The only way it actually ‘did something’ was when I took out the ‘Dane’ as in RowFields:=”Dane”. However it stopped working as soon as it hit a next occurance of ‘Dane’, which in this case was (copied from the original macro): ActiveSheet.PivotTables(“Tabela przestawna1”).PivotFields(“Dane”).PivotItems( _
        “Maksimum: ZUNI”).Position = 1

        I checked in the raw data and I had a column heading called ‘groups’ but Dane didn’t exist in the raw table at all. I have no idea what it is actually.
        Nevertheless, I got a copy of the file that my colleauge succesfully ran in Poland, and this is how the Dane is displayed in his report (see attached file).
        Any further ideas on how to solve this?
        Thanks in advance!
        K.

    • #742407

      I bet that “Tabela przestawna1” is Polish for “Pivot table1”. If you run the macro on an English-language system, your pivot table won’t be called “Tabela przestawna1”, of course. To be independent of the language, use PivotTables(1) instead of PivotTables(“Tabela przestawna1”), assuming that you have only one pivot table on the worksheet.
      Additionally, “Dane” and “Group” must be column headings in the source data for the pivot table.

    Viewing 1 reply thread
    Reply To: Reply #742434 in Pivot table addfields error (Excel 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information:




    Cancel