XL2000: Incorrect Classic PivotTable Format Constant Recorded in Macro

ID: Q236378


The information in this article applies to:
  • Microsoft Excel 2000


SYMPTOMS

When you run a recorded macro that formats a PivotTable, the PivotTable may be incorrectly formatted with the Report 1 style.


CAUSE

This problem may occur if you formatted your PivotTable with the PivotTable Classic AutoFormat when you recorded your macro.

In this case, the macro recorder adds an invalid constant (xlClassicPivotTable) to the Format method in your code. So, this constant gets evaluated to a value of zero, which is the same value as the xlReport1 constant.


WORKAROUND

To work around this problem, modify the macro code that was generated by the macro recorder as follows:

  1. Start the Visual Basic Editor (press ALT+F11).


  2. Replace the invalid constant xlClassicPivotTable with the correct constant xlPTClassic.


  3. Close the Visual Basic Editor (press ALT+F11).



STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.

Additional query words: XL2000

Keywords : kbmacro kbdta kbdtacode OffVBA KbVBA
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: October 14, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.