ShowPivotTableFieldList Property - Version issue/ How to replicate?

A

Alan

Hi All,

I have some code that uses the ShowPivotTableFieldList property.

It appears to run fine in Excel 2002, but not in Excel 2000.

I have searched in Excel 2000 help and can find no reference to that
property so I am guessing it was introduced in Excel 2002.

Similarly, a search of the MSDN library seems to back that up:

http://search.microsoft.com/search/...otTableFieldList&View=msdn&st=b&c=4&s=1&swc=4


Question:

How can I rewrite the line of code currently using that property to
work across all versions of excel (at least Excel 2000 to 2003
inclusive - Excel 97 is okay to ignore in this instance).

The line of code is currently:

objExcel.Workbooks(1).ShowPivotTableFieldList = False

Where objExcel is Excel.Application


Thank you in advance for any advice or guidance you can provide.

Regards,

Alan.
 
E

Ed Ferrero

Hi Alan,

The PivotTableFieldList did not exist in Excel 2000. Try wrapping your code
in an if statement like

If objExcel.Version > 9 Then
objExcel.Workbooks(1).ShowPivotTableFieldList = False
End If

Ed Ferrero
http://edferrero.m6.net
 
A

Alan

Ed Ferrero said:
Hi Alan,

The PivotTableFieldList did not exist in Excel 2000. Try wrapping
your code in an if statement like

If objExcel.Version > 9 Then
objExcel.Workbooks(1).ShowPivotTableFieldList = False
End If

Ed Ferrero
http://edferrero.m6.net

Hi Ed,

Thank you for your quick response.

That would certainly avoid the error message, but is there any way to
achieve the same result in Excel 2000 as that line would achieve in
Excel 2002?

Perhaps what I am really asking is, did the concept of a Pivot Table
Field List actually even exist in Excel 2000 (irrespective of whether
the ShowPivotTableFieldList property was available in VBA)?

Perhaps I would have to use SendKeys to do the same thing in Excel
2000 if it is not possible using VBA in that version?

Thanks for your assistance,

Alan.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top