PivotTable problem (form Nav 2.6 -> Excel 2000)

Hi, I created a PivotTable in Excel (from navision) based on a field ‘Model’ in the Row and based on a field ‘Month’ in the Column. I’m trying to create a PivotTable based on 2 fields in the Row and that won’t work. Here is the macro i generated from excel: ActiveSheet.PivotTables(“Pivottable3”).AddFields RowFields:=Array(“Model”, “Year”), ColumnFields:=“Month” Here is the code which works with only 1 row and 1 column autPivotTable.AddFields(‘Model’,‘Month’); (autPivotTable is DataType Automation ‘Microsoft Excel 9.0 Object Library’.PivotTable) Now, how can I add an second Row field? whats the code in Navision for that? ---------------------------------- Here are some screens from what i have as result now: Here are some screens from what i wanna have as result:

Hello, I think you cannot pass litteral array as argument in C/Side. There’s another problem because arguments in AddFields are optionals. AddFields([], [], [], []) And you have to set AddTotable to true Perhaps if you use a variant type variable as dummy argument this syntax could work : AutPivotTable.AddFields(‘Model’,‘Month’); AutPivotTable.AddFields(‘Year’,dummy,dummy,true); Have a nice day Patrick

Thx Patrick but what i need is the navision code. I know i wasn’t very clear about what i asked and I added some screenshots now to illustrate what i want. :slight_smile: I wanna generate all this from a Navision report. Thx in advance

Sorry I didn’t understand the problem in my original post I have edited it but you answer me before Give me a second chance [:)] See my new post Patrick

variant type variable isn’t available in version 2.6 (i think) so, still don’t know what to do, but thx for helping [:)] any other idea? [:)]