Excel: Changing Paper Sizes Using Page.Setup Macro Command

Last reviewed: November 1, 1994
Article ID: Q74974

SUMMARY

Microsoft Excel versions 3.0's Page.Setup macro command can be used to modify the paper size of a printout. This option does not work properly when executed from a chart, however.

MORE INFORMATION

One of the many arguments to the Page.Setup command is Paper_size. Paper_size is a number ranging from 1 to 26. These numbers correspond to various paper sizes that are documented in the "Microsoft Excel Function Reference." For example, number 5 corresponds to legal.

When running the Page.Setup command with a Paper_size argument of 5 and a worksheet or macro sheet active, Excel will correctly change the paper size to legal (assuming the current printer driver supports legal). However, when executing the same command with a chart active, Excel will incorrectly choose the fifth option from the Paper list box (in the dialog box that appears when you choose Page Setup from the File menu). For example, if the PostScript driver is the current driver, the Paper list box option changes to B5 rather than legal (B5 is the fifth option on the list of sizes).

In all Excel documents, the Page.Setup command will only change paper sizes for those printer drivers where the paper size can be changed from the Page Setup dialog box. Attempting to change the paper size with a printer driver that does not support this feature will result in a macro error if a chart is the active document, and no errors if a worksheet or macro sheet is active.

Microsoft is researching this problem and will post new information here as it becomes available.

REFERENCES

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


KBCategory: kbother
KBSubcategory:

Additional reference words: noupd


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 1, 1994
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.