ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel 2007: Pivot tables "Invalid procedure call or argument" (https://www.excelbanter.com/excel-programming/438302-excel-2007-pivot-tables-invalid-procedure-call-argument.html)

Paul Martin[_2_]

Excel 2007: Pivot tables "Invalid procedure call or argument"
 
Hi all

I'm having problems with pivot tables and coding that worked fine in
XL03 but is failing in XL07. My code fails when I attempt to set the
CurrentPage. I can manually change the CurrentPage to the value that
my code is attempting, and then the code works. I can manually change
the CurrentPage back again to its original value and the code works
again. It makes no sense why it's not working.

The line of code failing is this:

pt.PivotFields("Month").CurrentPage = CStr(12)

Thanks in advance

Paul Martin
Melbourne, Australia

Boris Geissler

Excel 2007: Pivot tables "Invalid procedure call or argument"
 
Try the following:

pt.PivotFields("Month").CurrentPage = CStr(12) & Chr(0)

On Tuesday, January 12, 2010 3:11 PM Paul Martin wrote:


Hi all

I am having problems with pivot tables and coding that worked fine in
XL03 but is failing in XL07. My code fails when I attempt to set the
CurrentPage. I can manually change the CurrentPage to the value that
my code is attempting, and then the code works. I can manually change
the CurrentPage back again to its original value and the code works
again. It makes no sense why it is not working.

The line of code failing is this:

pt.PivotFields("Month").CurrentPage = CStr(12)

Thanks in advance

Paul Martin
Melbourne, Australia



Submitted via EggHeadCafe
Microsoft LINQ Query Samples For Beginners
http://www.eggheadcafe.com/training-...Operators.aspx



All times are GMT +1. The time now is 01:38 AM.

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