Microsoft KB Archive/74974

{| = Excel: Changing Paper Sizes Using Page.Setup Macro Command =
 * width="100%"|

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 &quot;Microsoft Excel Function Reference.&quot; 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.