PrintQuality setting - is -3 a valid setting?

B

Bill G

What's the trick to avoid a run time error re: the PrintQuality setting in
Page Setup? Do I delete that line to let it default on the end users
machine?

I'm appending recorded code from both Excel 2003 SP2 and 2000, for what it's
worth. My main concern is re: 2003, but it'd be nice to know whatever other
hiccups might await me out there.

In 2000 the setting was in terms of dpi; in 2003 it's an index.I don't know
if that's material to the issue, though - a co-worker got the run time error
even though she's running the same version of Excel that I used to record
the macro (2003). The sub bombed on the PrintQuality line


The recorded code from 2003:

Sub PrintQuality2003Code()
'
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.75)
.RightMargin = Application.InchesToPoints(0.75)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = -3
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 100
.PrintErrors = xlPrintErrorsDisplayed
End With
End Sub


The recorded code from 2000:

Sub PrintQuality2000Code()
'
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.75)
.RightMargin = Application.InchesToPoints(0.75)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 100
End With
End Sub
 
N

NickHK

Bill,
For what's it's worth, the Object Browser, shows this for PrintQuality
Property PrintQuality([Index])
Excel.PageSetup

rather than
Property TopMargin As Double

I don't have Help or a printer installed here, so I can't check further.
What is -3 supposed to signify ?

NickHK
 
B

Bill G

Thanks - I believe it corresponds with the Medium setting. I think -1 is
Draft, thru to -4 for High.Looks like 2002 works the same way; just checked
it out on another machine.

'Excel VBA for Applications - 2nd Ed' from '96 by Jeff Webb discusses it.
Says -1 thru -4 are the valid settings. J. Walk's "Excel Power Programming
w/VBA" and "Excel 2003 VBA - programmer reference" (Kimmel, et al) don't
seem to discuss it much - or I haven't found it yet.

Found one Google result in Dutch or German where, I think, a related
question is being posed. Not sure - I took Spanish.


Hallo!
Bitte , wer kann mir mal näheres - zu oben - mitteilen.

ActiveSheet.pageSetup.Print Quality = -3


Was gibt -3 an ?
b.z.w. wo gibt es dazu Reverenzen ?


Danke schonmal
Jürgen


Reply



Grüezi Jürgen

Jürgen Stadermann schrieb:


ActiveSheet.pageSetup.Print Quality = -3
Was gibt -3 an ?
b.z.w. wo gibt es dazu Reverenzen ?



Stelle im VBA-Editor den Schreibcursor in das Wort 'PrintQuality' und
drücke F1. Bei korrekt installierte Online-Hilfe wirst Du direkt zum
Thema
'katapultiert'. ;-)

--
Mit freundlichen Grüssen


Thomas Ramel
- MVP für Microsoft-Excel -





NickHK said:
Bill,
For what's it's worth, the Object Browser, shows this for PrintQuality
Property PrintQuality([Index])
Excel.PageSetup

rather than
Property TopMargin As Double

I don't have Help or a printer installed here, so I can't check further.
What is -3 supposed to signify ?

NickHK

Bill G said:
What's the trick to avoid a run time error re: the PrintQuality setting
in
Page Setup? Do I delete that line to let it default on the end users
machine?

I'm appending recorded code from both Excel 2003 SP2 and 2000, for what
it's worth. My main concern is re: 2003, but it'd be nice to know
whatever
other hiccups might await me out there.

In 2000 the setting was in terms of dpi; in 2003 it's an index.I don't
know if that's material to the issue, though - a co-worker got the run
time error even though she's running the same version of Excel that I
used
to record the macro (2003). The sub bombed on the PrintQuality line


The recorded code from 2003:

Sub PrintQuality2003Code()
'
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.75)
.RightMargin = Application.InchesToPoints(0.75)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = -3
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 100
.PrintErrors = xlPrintErrorsDisplayed
End With
End Sub


The recorded code from 2000:

Sub PrintQuality2000Code()
'
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.75)
.RightMargin = Application.InchesToPoints(0.75)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 100
End With
End Sub
 
N

NickHK

Bill,
Excel XP & Excel 2000 seem to behave the same; it's the printer driver that
determines permitted values. Whilst it appears all drivers should support
the Index values, some don't.

Adobe PDF: PrintQuality takes a dpi value and errors with -1,-2 etc values.
HP Deskjet: PrintQuality takes -1,-2, etc value and errors with dpi values
MS Fax: PrintQuality = Array(200, 100) or dpi value and errors with -1,-2
etc values.

These values match those that appear in the "Print Quality" combo on the
Page setup dialog, not surprisingly.

Getting these values would probably require the GetPrinter, GetDeviceCaps
etc APIs as they are not exposed by Excel (or VB's Printer object).
A simpler approach would be to try a dpi value; if it error, try a -1 value.

NickHK

Bill G said:
Thanks - I believe it corresponds with the Medium setting. I think -1 is
Draft, thru to -4 for High.Looks like 2002 works the same way; just checked
it out on another machine.

'Excel VBA for Applications - 2nd Ed' from '96 by Jeff Webb discusses it.
Says -1 thru -4 are the valid settings. J. Walk's "Excel Power Programming
w/VBA" and "Excel 2003 VBA - programmer reference" (Kimmel, et al) don't
seem to discuss it much - or I haven't found it yet.

Found one Google result in Dutch or German where, I think, a related
question is being posed. Not sure - I took Spanish.


Hallo!
Bitte , wer kann mir mal näheres - zu oben - mitteilen.

ActiveSheet.pageSetup.Print Quality = -3


Was gibt -3 an ?
b.z.w. wo gibt es dazu Reverenzen ?


Danke schonmal
Jürgen


Reply



Grüezi Jürgen

Jürgen Stadermann schrieb:


ActiveSheet.pageSetup.Print Quality = -3
Was gibt -3 an ?
b.z.w. wo gibt es dazu Reverenzen ?



Stelle im VBA-Editor den Schreibcursor in das Wort 'PrintQuality' und
drücke F1. Bei korrekt installierte Online-Hilfe wirst Du direkt zum
Thema
'katapultiert'. ;-)

--
Mit freundlichen Grüssen


Thomas Ramel
- MVP für Microsoft-Excel -





NickHK said:
Bill,
For what's it's worth, the Object Browser, shows this for PrintQuality
Property PrintQuality([Index])
Excel.PageSetup

rather than
Property TopMargin As Double

I don't have Help or a printer installed here, so I can't check further.
What is -3 supposed to signify ?

NickHK

Bill G said:
What's the trick to avoid a run time error re: the PrintQuality setting
in
Page Setup? Do I delete that line to let it default on the end users
machine?

I'm appending recorded code from both Excel 2003 SP2 and 2000, for what
it's worth. My main concern is re: 2003, but it'd be nice to know
whatever
other hiccups might await me out there.

In 2000 the setting was in terms of dpi; in 2003 it's an index.I don't
know if that's material to the issue, though - a co-worker got the run
time error even though she's running the same version of Excel that I
used
to record the macro (2003). The sub bombed on the PrintQuality line


The recorded code from 2003:

Sub PrintQuality2003Code()
'
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.75)
.RightMargin = Application.InchesToPoints(0.75)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = -3
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 100
.PrintErrors = xlPrintErrorsDisplayed
End With
End Sub


The recorded code from 2000:

Sub PrintQuality2000Code()
'
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.75)
.RightMargin = Application.InchesToPoints(0.75)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 100
End With
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top