Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel VBA fails to print color 1

Status
Not open for further replies.

swtrader

IS-IT--Management
Dec 23, 2004
182
US
I am trying to use the following to consistently print an Excel sheet on a legal page, on a color printer, IN color.
If I work on something else (a Word doc) and print it to a different printer and print the doc in b&w, when I return to the spreadsheet and run this macro, the sheet prints in black and white.

IT has my default setting for the color printer set at B&W. Several different people will use this spreadsheet. I need everyone to be able to print it in color. Ideas?

Thanks.

==================================

Sub mcrPRINT_and_SAVE()
'
' mcrPRINT_and_SAVE Macro
'
'
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:=Range("AB4").Value
Application.DisplayAlerts = True
'
ActiveSheet.Unprotect
ActiveWindow.LargeScroll ToRight:=-1
Selection.AutoFilter Field:=1, Criteria1:="Display"
With ActiveSheet.PageSetup
.PrintTitleRows = "$1:$8"
.PrintTitleColumns = ""
End With
ActiveSheet.PageSetup.PrintArea = "$B$2:$Q$504"
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = "&""Arial,Bold""&8&Z&F&A"
.LeftMargin = Application.InchesToPoints(0.33)
.RightMargin = Application.InchesToPoints(0.51)
.TopMargin = Application.InchesToPoints(0.26)
.BottomMargin = Application.InchesToPoints(0.36)
.HeaderMargin = Application.InchesToPoints(0.2)
.FooterMargin = Application.InchesToPoints(0.21)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperLegal
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 5
.PrintErrors = xlPrintErrorsDisplayed
End With
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Selection.AutoFilter Field:=1
Application.Goto Reference:="AnchorCell"
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub


swtrader
-- If you don't know where you're going, you'll always know when you're not there.
 



"IT has my default setting for the color printer set at B&W."

I THINK that MAYBE, POSSIBLY, PERHAPS, PERADVENTURE, it MIGHT be that you should change your default.

Or you could set up another printer icon (to the same printer) that has color selected, and then select that printer in your code.

Skip,

[glasses] When a diminutive clarvoyant had disappeared from detention, headlines read...
Small Medium at Large[tongue]
 
Skip/

The IT guys say setting up another icon is an excellent suggestion and they'll set it up right away.

What a simple and perfect answer!

Thanks for this and for your frequent contributions to this group.



swtrader
-- If you don't know where you're going, you'll always know when you're not there.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top