Change printer properties in excel macro

前端 未结 1 1690
故里飘歌
故里飘歌 2020-12-30 06:55

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 ti

相关标签:
1条回答
  • 2020-12-30 07:07

    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.

    0 讨论(0)
提交回复
热议问题