Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

XL2000: Cannot Use Page Setup Property If No Printers Installed


View products that this article applies to.

Symptoms

If you run a Microsoft Visual Basic for Applications macro that attempts to set or get the page setup properties for any sheet in a workbook, you may receive either of the following error messages
Run-time error '1004': Unable to set the x property of the PageSetup class
-or-
Run-time error '1004': Unable to get the x property of the PageSetup class
where x is any of the following words:
   BlackAndWhite        Order
   BottomMargin         Orientation
   CenterFooter         PaperSize
   CenterHeader         PrintArea
   CenterHorizontally   PrintComments
   CenterVertically     PrintGridlines
   ChartSize            PrintHeadings
   Draft                PrintNotes
   FirstPageNumber      PrintQuality
   FitToPagesTall       PrintTitleColumns
   FitToPagesWide       PrintTitleRows
   FooterMargin         RightFooter
   HeaderMargin         RightHeader
   LeftFooter           RightMargin
   LeftHeader           TopMargin
   LeftMargin           Zoom
				

↑ Back to the top


Cause

This problem occurs when there are no printer drivers installed on your computer. Microsoft Excel cannot set or get page setup properties if no printer drivers are installed.

↑ Back to the top


Resolution

To prevent this problem from occurring, install a printer driver on your computer. Use the Printers option in Control Panel to add and remove printer drivers.

↑ Back to the top


More information

In Microsoft Excel, page setup properties are only available when you print or print preview one or more sheets in a workbook. Because of this, you cannot change or return most page setup properties unless at least one printer driver is installed as the default printer.

If you click Page Setup on the File menu when no printer drivers are installed, you receive the following error message:
There are no printers installed. Use the Printers option in Control Panel to install a printer.
Just as you cannot access the Page Setup dialog box in this case, you cannot access the properties in the dialog box programmatically.

↑ Back to the top


Article Info
Article ID : 213516
Revision : 4
Created on : 1/1/0001
Published on : 1/1/0001
Exists online : False
Views : 308