ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   PivotTable DefaultVersion (https://www.excelbanter.com/excel-programming/283433-pivottable-defaultversion.html)

Malik[_3_]

PivotTable DefaultVersion
 
Hi folks,

I have developed a pivotTable in Excel 2002 that only has Row fields,
with no column, data or page fields. The only reason I'm doing this is
that it makes my report look nicer :)

However, I noticed that this statement bombs on earlier versions of
Excel:

ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase,
SourceData:= _
Range(Cells(7, 31), Cells(1000, 37)).Address).CreatePivotTable
_
TableDestination:= tblDestination, TableName:="PivotTable2", _
DefaultVersion:=xlPivotTableVersion10

So I tried taking out the DefaultVersion parameter of the
CreatePivotTable method. But when I do that, I end up with no data
displayed in my pivotTable report! All the data is in the report, but
none is displayed until I add some data fields.

Is there something in Excel 2002 that allows me to display only row
fields in a PivotTable report? Please help with any suggestions, as my
report needs to work with earlier versions of Excel.

Thank you,
Malik

Tom Ogilvy

PivotTable DefaultVersion
 
Which version are you calling an earlier version. I don't believe the
PivotCache had an add method in xl97. The pivot table was created using the
pivotwizard method of the Pivot Table object.

Perhaps this is your problem.

--
Regards,
Tom Ogilvy

"Malik" wrote in message
om...
Hi folks,

I have developed a pivotTable in Excel 2002 that only has Row fields,
with no column, data or page fields. The only reason I'm doing this is
that it makes my report look nicer :)

However, I noticed that this statement bombs on earlier versions of
Excel:

ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase,
SourceData:= _
Range(Cells(7, 31), Cells(1000, 37)).Address).CreatePivotTable
_
TableDestination:= tblDestination, TableName:="PivotTable2", _
DefaultVersion:=xlPivotTableVersion10

So I tried taking out the DefaultVersion parameter of the
CreatePivotTable method. But when I do that, I end up with no data
displayed in my pivotTable report! All the data is in the report, but
none is displayed until I add some data fields.

Is there something in Excel 2002 that allows me to display only row
fields in a PivotTable report? Please help with any suggestions, as my
report needs to work with earlier versions of Excel.

Thank you,
Malik




Abdul Malik Said

PivotTable DefaultVersion
 
Sorry, I should have said that I really only tested this on Excel 2000.
Thanks for the info on Excel 97 though, as I may modify my code to
conditionally take that into account.

Another detail of this problem is that the "Show Items with No Data"
checkbox IS checked for each field in the pivotTable. Maybe this feature was
not in Excel 2000?...

I have bought a book on the subject, and now I realize that trying to
support any kind of advanced features across multiple versions of Excel is a
nightmare...

Thanks for your help.
Malik

"Tom Ogilvy" wrote in message
...
Which version are you calling an earlier version. I don't believe the
PivotCache had an add method in xl97. The pivot table was created using

the
pivotwizard method of the Pivot Table object.

Perhaps this is your problem.

--
Regards,
Tom Ogilvy

"Malik" wrote in message
om...
Hi folks,

I have developed a pivotTable in Excel 2002 that only has Row fields,
with no column, data or page fields. The only reason I'm doing this is
that it makes my report look nicer :)

However, I noticed that this statement bombs on earlier versions of
Excel:

ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase,
SourceData:= _
Range(Cells(7, 31), Cells(1000, 37)).Address).CreatePivotTable
_
TableDestination:= tblDestination, TableName:="PivotTable2", _
DefaultVersion:=xlPivotTableVersion10

So I tried taking out the DefaultVersion parameter of the
CreatePivotTable method. But when I do that, I end up with no data
displayed in my pivotTable report! All the data is in the report, but
none is displayed until I add some data fields.

Is there something in Excel 2002 that allows me to display only row
fields in a PivotTable report? Please help with any suggestions, as my
report needs to work with earlier versions of Excel.

Thank you,
Malik







All times are GMT +1. The time now is 05:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com