Tim.DeVries
Tim.DeVries

Reputation: 851

Change printer properties in excel macro

Is there any way I can change printer properties to color rather than black and white in an Excel macro/Excel VBA? I would like to print in color from the macro but every time I exit excel it sets the color to black and white. I would like for the macro to set the color back to color every time I run it. This is the code I am using to print:

Workbooks("Book1.xlsm").Worksheets("Sheet3").PrintOut from:=1, To:=(i / 2) - 0.5

This prints every page effected by the macro but it does it in black and white. I have already tried this but it didn't change anything:

Workbooks("Book1.xlsm").Worksheets("Sheet3").PageSetup.BlackAndWhite = False

If it isn't possible to do this in vba I would be fine with an API solution as well.

Upvotes: 13

Views: 27862

Answers (1)

Jo Jo
Jo Jo

Reputation: 79

Rather than using:

Workbooks("Book1.xlsm").Worksheets("Sheet3").PrintOut from:=1, To:=(i / 2) - 0.5

You could just use:

Workbooks("Book1.xlsm").Worksheets("Sheet3").PrintOut

and you can skip:

Workbooks("Book1.xlsm").Worksheets("DoNotDelete").PageSetup.BlackAndWhite = False

Because it only changes the worksheet settings, not the print settings.

But as far as printing in color goes you are probably best off just creating a shortcut the same printer twice in the control panel and set one to default color and another to default black and white. This way you can specify color or black/white just by which printer you choose.

Upvotes: 7

Related Questions