メイン コンテンツへスキップ
サポート
Microsoft アカウントでサインイン
サインインまたはアカウントを作成してください。
こんにちは、
別のアカウントを選択してください。
複数のアカウントがあります
サインインに使用するアカウントを選択してください。
英語
申し訳ございません。この記事は、ご利用の言語では用意されていません。

For a Microsoft Excel 2000 version of this article, see 213516.

For a Microsoft Excel 98 version of this article, see 182243.

For a Microsoft Excel 97 and earlier versions of Excel version of this article, see 172320.

Symptoms

When 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 in Microsoft Excel, you may receive either of the following error messages:

Run-time error '1004': Unable to set the x property of the PageSetup class

Run-time error '1004': Unable to get the x property of the PageSetup class

Note In these messages, 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

Cause

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

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.

More Information

In Excel, page setup properties are only available when you print or 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.



Note To open the Page Setup dialog box in Microsoft Office Excel 2007, press CTRL+F2, and then click Page Setup in the Print group.

ヘルプを表示

その他のオプションが必要ですか?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

この情報は役に立ちましたか?

どのような要因がお客様の操作性に影響しましたか?
[送信] を押すと、Microsoft の製品とサービスの改善にフィードバックが使用されます。 IT 管理者はこのデータを収集できます。 プライバシーに関する声明。

フィードバックをいただき、ありがとうございます。

×