Excel: PAGE.SETUP Halts Macro with Show Info Window Active

Last reviewed: November 16, 1994
Article ID: Q80366
The information in this article applies to:
  • Microsoft Excel for Windows, version 3.0

SUMMARY

If a Show Info window is active in Microsoft Excel, running a macro with the PAGE.SETUP function may result in a macro error if the function includes parameters for row and column headings and gridlines. (To access the Show Info window, choose Show Info from the Window menu.)

MORE INFORMATION

With a Show Info window active, the File Page Setup command allows you to change the values in the Header and Footer text boxes and the Left, Right, Top, and Bottom Margins text boxes. Depending on the printer driver you're using, you may also be able to change the Orientation, Paper, and Scaling options. The Row & Column Headings and Gridlines check boxes are not present, and the Center Horizontally and Center Vertically check boxes are unavailable (dimmed).

While there is no documented PAGE.SETUP function specifically for a Show Info window, including all of the 13 possible parameters will cause the macro to halt. The macro recorder will record the function with only 11 parameters, omitting the headings and gridlines because the appropriate options do not appear in the Page Setup dialog box. FALSE,FALSE will be recorded for H_Center and V_Center.

Workaround

Remove the parameters in the PAGE.SETUP function for headings and gridlines.

Steps to Reproduce Problem

  1. Enter the following into cell A2 of a new macro sheet:

    =PAGE.SETUP("&F","&P",0.75,0.75,1,1,FALSE,TRUE,FALSE,FALSE,1,1,100)

  2. In cell A3, type:

          =RETURN()
    

  3. In cell A1, type:

          test
    

  4. Make cell A1 the active cell and choose Define Name from the Formula menu. Select Command in the Macro section and choose OK.

  5. From the Window menu, choose Show Info.

  6. From the Macro menu, choose Run. Select Test and choose OK. The macro will halt at cell A2.

  7. Remove the first two boolean parameters (headings and gridlines) so that the function appears as follows:

          =PAGE.SETUP("&F","&P",0.75,0.75,1,1,FALSE,FALSE,1,1,100)
    

The macro will now run successfully without error.

REFERENCES

"Microsoft Excel Function Reference," version 3.0, pages 173-175


KBCategory: kbprint
KBSubcategory:

Additional reference words: 3.00 page setup ()


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 16, 1994
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.