Name

pagesetup.PrintQuality(index) [= setting]

Synopsis

Sets or returns the horizontal and vertical print resolution as a two-element array. Some printers do not support multiple resolutions, and setting PrintQuality causes an error if the setting is not available or if the object is a chart. The following code displays the printer resolution settings:

Sub ShowResolution(  )
    Dim ws As Worksheet, x As Integer, y As Integer
    Set ws = ActiveSheet
    x = ws.PageSetup.PrintQuality(1)
    y = ws.PageSetup.PrintQuality(2)
    MsgBox "Printer resolution is " & x & "x" & y
End Sub

Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.