printing using macro

L

Latin Seminary

Hi,
I assgined a macro to a "text box" using "record new macro". This macro
prints a certain range of cells on a laser printer.
When I replaced the printer with a colored one: HP deskjet and run the
macro it didn't print.
following is the code of the macro:
Sub TextBox1_Click()
Range("A14:F26").Select
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.748031496062992)
.RightMargin = Application.InchesToPoints(0.748031496062992)
.TopMargin = Application.InchesToPoints(0.984251968503937)
.BottomMargin = Application.InchesToPoints(0.984251968503937)
.HeaderMargin = Application.InchesToPoints(0.511811023622047)
.FooterMargin = Application.InchesToPoints(0.511811023622047)
.PrintHeadings = False
.PrintGridlines = True
.PrintComments = xlPrintNoComments
.PrintQuality = 300
.CenterHorizontally = True
.CenterVertically = True
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperA4
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 100
.PrintErrors = xlPrintErrorsDisplayed
End With
Selection.PrintOut Copies:=1, Preview:=True, Collate:=True
End Sub

Can anyone help
Khalil
 
C

Carlos Antenna

When you record a macro it dumps all the available settings for your printer
into the macro whether or not you made changes to that parameter. When you
change printers this becomes a problem because some of the default settings
on the old printer may not be available on the new one, or they may be
simply out of range. (Does the new one print as close to the edge as the
old one?)

I would suggest re-recording the macro with the new printer set as the
default.

--Carlos
 
W

Wayman Bell

Something similar to this might work.

ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
 

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